mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-20 09:04:42 +01:00
fixes #433 - Add root collection type to ItemResolveArgs
This commit is contained in:
@@ -441,7 +441,7 @@ namespace MediaBrowser.Server.Implementations.Library
|
||||
throw new ArgumentNullException("fileInfo");
|
||||
}
|
||||
|
||||
var args = new ItemResolveArgs(ConfigurationManager.ApplicationPaths)
|
||||
var args = new ItemResolveArgs(ConfigurationManager.ApplicationPaths, this)
|
||||
{
|
||||
Parent = parent,
|
||||
Path = fileInfo.FullName,
|
||||
|
||||
@@ -14,13 +14,6 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Audio
|
||||
/// </summary>
|
||||
public class MusicAlbumResolver : ItemResolver<MusicAlbum>
|
||||
{
|
||||
private readonly ILibraryManager _libraryManager;
|
||||
|
||||
public MusicAlbumResolver(ILibraryManager libraryManager)
|
||||
{
|
||||
_libraryManager = libraryManager;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the priority.
|
||||
/// </summary>
|
||||
@@ -44,7 +37,7 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Audio
|
||||
if (args.Parent.IsRoot) return null;
|
||||
if (args.Parent is MusicAlbum) return null;
|
||||
|
||||
var collectionType = args.Parent == null ? null : _libraryManager.FindCollectionType(args.Parent);
|
||||
var collectionType = args.GetCollectionType();
|
||||
|
||||
// If there's a collection type and it's not music, it can't be a series
|
||||
if (!string.IsNullOrEmpty(collectionType) &&
|
||||
|
||||
@@ -13,13 +13,6 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Audio
|
||||
/// </summary>
|
||||
public class MusicArtistResolver : ItemResolver<MusicArtist>
|
||||
{
|
||||
private readonly ILibraryManager _libraryManager;
|
||||
|
||||
public MusicArtistResolver(ILibraryManager libraryManager)
|
||||
{
|
||||
_libraryManager = libraryManager;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the priority.
|
||||
/// </summary>
|
||||
@@ -48,7 +41,7 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Audio
|
||||
return null;
|
||||
}
|
||||
|
||||
var collectionType = args.Parent == null ? null : _libraryManager.FindCollectionType(args.Parent);
|
||||
var collectionType = args.GetCollectionType();
|
||||
|
||||
// If there's a collection type and it's not music, it can't be a series
|
||||
if (!string.IsNullOrEmpty(collectionType) &&
|
||||
|
||||
@@ -17,12 +17,12 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
|
||||
/// </summary>
|
||||
public class MovieResolver : BaseVideoResolver<Video>
|
||||
{
|
||||
private IServerApplicationPaths ApplicationPaths { get; set; }
|
||||
private readonly IServerApplicationPaths _applicationPaths;
|
||||
private readonly ILibraryManager _libraryManager;
|
||||
|
||||
public MovieResolver(IServerApplicationPaths appPaths, ILibraryManager libraryManager)
|
||||
{
|
||||
ApplicationPaths = appPaths;
|
||||
_applicationPaths = appPaths;
|
||||
_libraryManager = libraryManager;
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
|
||||
}
|
||||
}
|
||||
|
||||
var collectionType = args.Parent == null ? null : _libraryManager.FindCollectionType(args.Parent);
|
||||
var collectionType = args.GetCollectionType();
|
||||
|
||||
// Find movies with their own folders
|
||||
if (isDirectory)
|
||||
@@ -234,7 +234,7 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
|
||||
continue;
|
||||
}
|
||||
|
||||
var childArgs = new ItemResolveArgs(ApplicationPaths)
|
||||
var childArgs = new ItemResolveArgs(_applicationPaths, _libraryManager)
|
||||
{
|
||||
FileInfo = child,
|
||||
Path = child.FullName
|
||||
|
||||
@@ -13,13 +13,6 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.TV
|
||||
/// </summary>
|
||||
public class SeriesResolver : FolderResolver<Series>
|
||||
{
|
||||
private readonly ILibraryManager _libraryManager;
|
||||
|
||||
public SeriesResolver(ILibraryManager libraryManager)
|
||||
{
|
||||
_libraryManager = libraryManager;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the priority.
|
||||
/// </summary>
|
||||
@@ -53,7 +46,7 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.TV
|
||||
return null;
|
||||
}
|
||||
|
||||
var collectionType = args.Parent == null ? null : _libraryManager.FindCollectionType(args.Parent);
|
||||
var collectionType = args.GetCollectionType();
|
||||
|
||||
// If there's a collection type and it's not tv, it can't be a series
|
||||
if (!string.IsNullOrEmpty(collectionType) &&
|
||||
|
||||
Reference in New Issue
Block a user