mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-22 10:04:44 +01:00
fixes #433 - Add root collection type to ItemResolveArgs
This commit is contained in:
@@ -327,7 +327,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
if (LocationType == LocationType.Remote || LocationType == LocationType.Virtual)
|
||||
{
|
||||
return new ItemResolveArgs(ConfigurationManager.ApplicationPaths);
|
||||
return new ItemResolveArgs(ConfigurationManager.ApplicationPaths, LibraryManager);
|
||||
}
|
||||
|
||||
var isDirectory = false;
|
||||
@@ -345,7 +345,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
throw new IOException("Unable to retrieve file system info for " + path);
|
||||
}
|
||||
|
||||
var args = new ItemResolveArgs(ConfigurationManager.ApplicationPaths)
|
||||
var args = new ItemResolveArgs(ConfigurationManager.ApplicationPaths, LibraryManager)
|
||||
{
|
||||
FileInfo = pathInfo,
|
||||
Path = path,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.IO;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
@@ -17,14 +16,17 @@ namespace MediaBrowser.Controller.Library
|
||||
/// The _app paths
|
||||
/// </summary>
|
||||
private readonly IServerApplicationPaths _appPaths;
|
||||
private readonly ILibraryManager _libraryManager;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ItemResolveArgs" /> class.
|
||||
/// </summary>
|
||||
/// <param name="appPaths">The app paths.</param>
|
||||
public ItemResolveArgs(IServerApplicationPaths appPaths)
|
||||
/// <param name="libraryManager">The library manager.</param>
|
||||
public ItemResolveArgs(IServerApplicationPaths appPaths, ILibraryManager libraryManager)
|
||||
{
|
||||
_appPaths = appPaths;
|
||||
_libraryManager = libraryManager;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -368,6 +370,11 @@ namespace MediaBrowser.Controller.Library
|
||||
return GetFileSystemEntryByName(name) != null;
|
||||
}
|
||||
|
||||
public string GetCollectionType()
|
||||
{
|
||||
return Parent == null ? null : _libraryManager.FindCollectionType(Parent);
|
||||
}
|
||||
|
||||
#region Equality Overrides
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user