mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-10-17 12:01:01 -04:00
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>
This commit is contained in:
parent
c7320dc189
commit
d9eaeed61d
@ -374,13 +374,22 @@ namespace Emby.Server.Implementations.Library
|
|||||||
|
|
||||||
if (request.GroupItems)
|
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;
|
query.Limit = limit;
|
||||||
return _libraryManager.GetLatestItemList(query, parents, CollectionType.tvshows);
|
return _libraryManager.GetLatestItemList(query, parents, CollectionType.tvshows);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (parents.OfType<ICollectionFolder>().All(i => i.CollectionType == CollectionType.music))
|
if (collectionType == CollectionType.music)
|
||||||
{
|
{
|
||||||
query.Limit = limit;
|
query.Limit = limit;
|
||||||
return _libraryManager.GetLatestItemList(query, parents, CollectionType.music);
|
return _libraryManager.GetLatestItemList(query, parents, CollectionType.music);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user