aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2015-09-20 11:29:29 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2015-09-20 11:29:29 -0400
commit3a900f9d9065a668c5b83f63a036aa0a5eeb48b1 (patch)
tree628df73ded469cc2957e5a183538e8d7c39e9ed7
parentb3bdb3b21dea4a88a2666e9ea80edd2c17e6ef6d (diff)
fix id parsing in MovieResolver
-rw-r--r--MediaBrowser.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs28
1 files changed, 17 insertions, 11 deletions
diff --git a/MediaBrowser.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs b/MediaBrowser.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs
index 0d1e4202c..ff38e057b 100644
--- a/MediaBrowser.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs
+++ b/MediaBrowser.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs
@@ -125,7 +125,7 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
}
else if (IsIgnored(child.Name))
{
-
+
}
else
{
@@ -309,20 +309,26 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
//we need to only look at the name of this actual item (not parents)
var justName = item.IsInMixedFolder ? Path.GetFileName(item.Path) : Path.GetFileName(item.ContainingFolderPath);
- // check for tmdb id
- var tmdbid = justName.GetAttributeValue("tmdbid");
-
- if (!string.IsNullOrEmpty(tmdbid))
+ if (!string.IsNullOrWhiteSpace(justName))
{
- item.SetProviderId(MetadataProviders.Tmdb, tmdbid);
- }
+ // check for tmdb id
+ var tmdbid = justName.GetAttributeValue("tmdbid");
- // check for imdb id - we use full media path, as we can assume, that this will match in any use case (wither id in parent dir or in file name)
- var imdbid = item.Path.GetAttributeValue("imdbid");
+ if (!string.IsNullOrWhiteSpace(tmdbid))
+ {
+ item.SetProviderId(MetadataProviders.Tmdb, tmdbid);
+ }
+ }
- if (!string.IsNullOrEmpty(imdbid))
+ if (!string.IsNullOrWhiteSpace(item.Path))
{
- item.SetProviderId(MetadataProviders.Imdb, imdbid);
+ // check for imdb id - we use full media path, as we can assume, that this will match in any use case (wither id in parent dir or in file name)
+ var imdbid = item.Path.GetAttributeValue("imdbid");
+
+ if (!string.IsNullOrWhiteSpace(imdbid))
+ {
+ item.SetProviderId(MetadataProviders.Imdb, imdbid);
+ }
}
}
}