From e4040ab812f30cc72436ce01b845f10717019276 Mon Sep 17 00:00:00 2001 From: Joe Rogers <1337joe@gmail.com> Date: Tue, 17 May 2022 22:58:49 +0200 Subject: Allow video extras to use owner library options --- .../Library/LibraryManager.cs | 37 ++++++++++------------ 1 file changed, 17 insertions(+), 20 deletions(-) (limited to 'Emby.Server.Implementations/Library/LibraryManager.cs') diff --git a/Emby.Server.Implementations/Library/LibraryManager.cs b/Emby.Server.Implementations/Library/LibraryManager.cs index 4bbb391cc..bf12e4e0a 100644 --- a/Emby.Server.Implementations/Library/LibraryManager.cs +++ b/Emby.Server.Implementations/Library/LibraryManager.cs @@ -1998,39 +1998,36 @@ namespace Emby.Server.Implementations.Library } public List GetCollectionFolders(BaseItem item) + { + return GetCollectionFolders(item, GetUserRootFolder().Children.OfType()); + } + + public List GetCollectionFolders(BaseItem item, IEnumerable allUserRootChildren) { while (item is not null) { var parent = item.GetParent(); - if (parent is null || parent is AggregateFolder) + if (parent is AggregateFolder) { break; } - item = parent; - } - - if (item is null) - { - return new List(); - } - - return GetCollectionFoldersInternal(item, GetUserRootFolder().Children.OfType()); - } + if (parent is null) + { + var owner = item.GetOwner(); - public List GetCollectionFolders(BaseItem item, List allUserRootChildren) - { - while (item is not null) - { - var parent = item.GetParent(); + if (owner is null) + { + break; + } - if (parent is null || parent is AggregateFolder) + item = owner; + } + else { - break; + item = parent; } - - item = parent; } if (item is null) -- cgit v1.2.3