Skip to content

The Free Software Media System - Server Backend & API

More generic collection folder filter handling

Shadowghost5b4882c10224
diff --git a/Jellyfin.Api/Controllers/ItemsController.cs b/Jellyfin.Api/Controllers/ItemsController.cs
index 97183f09d4..da52e7b23e 100644
--- a/Jellyfin.Api/Controllers/ItemsController.cs
+++ b/Jellyfin.Api/Controllers/ItemsController.cs
@@ -299,17 +299,20 @@ public class ItemsController : BaseJellyfinApiController
recursive = true;
includeItemTypes = new[] { BaseItemKind.Playlist };
}
- else if (folder is ICollectionFolder && includeItemTypes.Length == 0)
+ else if (folder is ICollectionFolder)
{
// When the client doesn't specify recursive/includeItemTypes, force the query
// through the database path where all filters (IsHD, genres, etc.) are applied.
- recursive = true;
- includeItemTypes = collectionType switch
+ recursive ??= true;
+ if (includeItemTypes.Length == 0)
{
- CollectionType.boxsets => [BaseItemKind.BoxSet],
- null => [BaseItemKind.Movie, BaseItemKind.Series], // mixed
- _ => []
- };
+ includeItemTypes = collectionType switch
+ {
+ CollectionType.boxsets => [BaseItemKind.BoxSet],
+ null => [BaseItemKind.Movie, BaseItemKind.Series],
+ _ => []
+ };
+ }
}
if (item is not UserRootFolder