fixes #383 - boxsets seem to ignore tmdbid tag in file path
This commit is contained in:
parent
02bb0fb20f
commit
6992d31155
|
@ -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 MediaBrowser.Controller.Library;
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using MediaBrowser.Model.Entities;
|
||||||
|
|
||||||
namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
|
namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
|
||||||
{
|
{
|
||||||
|
@ -37,5 +40,34 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sets the initial item values.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="item">The item.</param>
|
||||||
|
/// <param name="args">The args.</param>
|
||||||
|
protected override void SetInitialItemValues(BoxSet item, ItemResolveArgs args)
|
||||||
|
{
|
||||||
|
base.SetInitialItemValues(item, args);
|
||||||
|
|
||||||
|
SetProviderIdFromPath(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sets the provider id from path.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="item">The item.</param>
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,8 +74,7 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
|
||||||
}
|
}
|
||||||
|
|
||||||
// A shortcut to help us resolve faster in some cases
|
// A shortcut to help us resolve faster in some cases
|
||||||
var isKnownMovie = args.ContainsMetaFileByName("movie.xml") || args.ContainsMetaFileByName("tmdb3.json") ||
|
var isKnownMovie = args.ContainsMetaFileByName("movie.xml");
|
||||||
args.Path.IndexOf("[tmdbid", StringComparison.OrdinalIgnoreCase) != -1;
|
|
||||||
|
|
||||||
if (args.Path.IndexOf("[trailers]", StringComparison.OrdinalIgnoreCase) != -1)
|
if (args.Path.IndexOf("[trailers]", StringComparison.OrdinalIgnoreCase) != -1)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user