diff options
Diffstat (limited to 'MediaBrowser.Server.Implementations/Library/LibraryManager.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Library/LibraryManager.cs | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs index aac4c87f5..e6e6b8c74 100644 --- a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs +++ b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs @@ -401,7 +401,7 @@ namespace MediaBrowser.Server.Implementations.Library } catch (DirectoryNotFoundException) { - + } catch (Exception ex) { @@ -1489,6 +1489,23 @@ namespace MediaBrowser.Server.Implementations.Library return ItemRepository.RetrieveItem(id); } + public IEnumerable<Folder> GetCollectionFolders(BaseItem item) + { + while (!(item.Parent is AggregateFolder) && item.Parent != null) + { + item = item.Parent; + } + + if (item == null) + { + return new List<Folder>(); + } + + return GetUserRootFolder().Children + .OfType<Folder>() + .Where(i => string.Equals(i.Path, item.Path, StringComparison.OrdinalIgnoreCase) || i.PhysicalLocations.Contains(item.Path)); + } + public string GetContentType(BaseItem item) { string configuredContentType = GetConfiguredContentType(item, false); @@ -1547,7 +1564,7 @@ namespace MediaBrowser.Server.Implementations.Library } return null; } - + private string GetTopFolderContentType(BaseItem item) { while (!(item.Parent is AggregateFolder) && item.Parent != null) @@ -1840,7 +1857,7 @@ namespace MediaBrowser.Server.Implementations.Library options.VideoFileExtensions.Remove(".rar"); options.VideoFileExtensions.Remove(".zip"); } - + return options; } |
