aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations
diff options
context:
space:
mode:
authortheguymadmax <theguymadmax@proton.me>2025-09-05 05:05:37 -0400
committerGitHub <noreply@github.com>2025-09-05 11:05:37 +0200
commitd9eaeed61dd95c730e8d14a9ed79d68b2f62ac69 (patch)
treeb13b2a377a23ee3127b36d2003273807d3d18668 /Emby.Server.Implementations
parentc7320dc1898f3fb5c4b1b1f62026865b0926b0b5 (diff)
Fix latest items grouping by collection type (#14736)
* Fix latest items grouping by collection type * Update Emby.Server.Implementations/Library/UserViewManager.cs Co-authored-by: Bond-009 <bond.009@outlook.com> --------- Co-authored-by: Bond-009 <bond.009@outlook.com>
Diffstat (limited to 'Emby.Server.Implementations')
-rw-r--r--Emby.Server.Implementations/Library/UserViewManager.cs13
1 files changed, 11 insertions, 2 deletions
diff --git a/Emby.Server.Implementations/Library/UserViewManager.cs b/Emby.Server.Implementations/Library/UserViewManager.cs
index 87214c273..6fb53ff15 100644
--- a/Emby.Server.Implementations/Library/UserViewManager.cs
+++ b/Emby.Server.Implementations/Library/UserViewManager.cs
@@ -374,13 +374,22 @@ namespace Emby.Server.Implementations.Library
if (request.GroupItems)
{
- if (parents.OfType<ICollectionFolder>().All(i => i.CollectionType == CollectionType.tvshows))
+ var collectionType = parents
+ .Select(parent => parent switch
+ {
+ ICollectionFolder collectionFolder => collectionFolder.CollectionType,
+ UserView userView => userView.CollectionType,
+ _ => null
+ })
+ .FirstOrDefault(type => type is not null);
+
+ if (collectionType == CollectionType.tvshows)
{
query.Limit = limit;
return _libraryManager.GetLatestItemList(query, parents, CollectionType.tvshows);
}
- if (parents.OfType<ICollectionFolder>().All(i => i.CollectionType == CollectionType.music))
+ if (collectionType == CollectionType.music)
{
query.Limit = limit;
return _libraryManager.GetLatestItemList(query, parents, CollectionType.music);