diff --git a/MediaBrowser.Server.Implementations/Library/Resolvers/Movies/BoxSetResolver.cs b/MediaBrowser.Server.Implementations/Library/Resolvers/Movies/BoxSetResolver.cs index fc3906ebb..180e251b4 100644 --- a/MediaBrowser.Server.Implementations/Library/Resolvers/Movies/BoxSetResolver.cs +++ b/MediaBrowser.Server.Implementations/Library/Resolvers/Movies/BoxSetResolver.cs @@ -1,7 +1,10 @@ -using MediaBrowser.Controller.Entities.Movies; +using MediaBrowser.Common.Extensions; +using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller.Entities.Movies; using MediaBrowser.Controller.Library; using System; using System.IO; +using MediaBrowser.Model.Entities; namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies { @@ -37,5 +40,34 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies return null; } + + /// + /// Sets the initial item values. + /// + /// The item. + /// The args. + protected override void SetInitialItemValues(BoxSet item, ItemResolveArgs args) + { + base.SetInitialItemValues(item, args); + + SetProviderIdFromPath(item); + } + + /// + /// Sets the provider id from path. + /// + /// The item. + private void SetProviderIdFromPath(BaseItem item) + { + //we need to only look at the name of this actual item (not parents) + var justName = Path.GetFileName(item.Path); + + var id = justName.GetAttributeValue("tmdbid"); + + if (!string.IsNullOrEmpty(id)) + { + item.SetProviderId(MetadataProviders.Tmdb, id); + } + } } } diff --git a/MediaBrowser.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs b/MediaBrowser.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs index 2c856fb1a..f65e2a39a 100644 --- a/MediaBrowser.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs +++ b/MediaBrowser.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs @@ -74,8 +74,7 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies } // A shortcut to help us resolve faster in some cases - var isKnownMovie = args.ContainsMetaFileByName("movie.xml") || args.ContainsMetaFileByName("tmdb3.json") || - args.Path.IndexOf("[tmdbid", StringComparison.OrdinalIgnoreCase) != -1; + var isKnownMovie = args.ContainsMetaFileByName("movie.xml"); if (args.Path.IndexOf("[trailers]", StringComparison.OrdinalIgnoreCase) != -1) {