aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api/Controllers/ItemsController.cs
diff options
context:
space:
mode:
authorShadowghost <Ghost_of_Stone@web.de>2026-05-24 18:25:12 +0200
committerShadowghost <Ghost_of_Stone@web.de>2026-05-24 18:25:12 +0200
commit11758461200c7b369dd23db5ac7c9f232a87cf21 (patch)
tree59a9a8574531ed05fb09720eb51cec38741f8397 /Jellyfin.Api/Controllers/ItemsController.cs
parentea8f6c51fd1013b6c841fb74a7fcde532d57d8da (diff)
parent31f4ce93a6c4eef9167bea9afb06d01e5597a64a (diff)
Merge remote-tracking branch 'upstream/master' into search-rebased
Diffstat (limited to 'Jellyfin.Api/Controllers/ItemsController.cs')
-rw-r--r--Jellyfin.Api/Controllers/ItemsController.cs19
1 files changed, 16 insertions, 3 deletions
diff --git a/Jellyfin.Api/Controllers/ItemsController.cs b/Jellyfin.Api/Controllers/ItemsController.cs
index 234282f7bd..679f6fafc2 100644
--- a/Jellyfin.Api/Controllers/ItemsController.cs
+++ b/Jellyfin.Api/Controllers/ItemsController.cs
@@ -15,6 +15,7 @@ using MediaBrowser.Controller.Dto;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Movies;
using MediaBrowser.Controller.Library;
+using MediaBrowser.Controller.Playlists;
using MediaBrowser.Controller.Session;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
@@ -276,7 +277,7 @@ public class ItemsController : BaseJellyfinApiController
&& user.GetPreference(PreferenceKind.AllowedTags).Length != 0
&& !fields.Contains(ItemFields.Tags))
{
- fields = [..fields, ItemFields.Tags];
+ fields = [.. fields, ItemFields.Tags];
}
var dtoOptions = new DtoOptions { Fields = fields }
@@ -285,10 +286,21 @@ public class ItemsController : BaseJellyfinApiController
var item = _libraryManager.GetParentItem(parentId, userId);
QueryResult<BaseItem> result;
+ Guid[] linkedChildAncestorIds = [];
if (includeItemTypes.Length == 1
- && includeItemTypes[0] == BaseItemKind.BoxSet
- && item is not BoxSet)
+ && (includeItemTypes[0] == BaseItemKind.BoxSet || includeItemTypes[0] == BaseItemKind.Playlist)
+ && item is not BoxSet
+ && item is not Playlist)
{
+ var itemCollectionType = item is IHasCollectionType hct ? hct.CollectionType : null;
+ var targetCollectionType = includeItemTypes[0] == BaseItemKind.BoxSet
+ ? CollectionType.boxsets
+ : CollectionType.playlists;
+ if (parentId.HasValue && item is not UserRootFolder && itemCollectionType != targetCollectionType)
+ {
+ linkedChildAncestorIds = [parentId.Value];
+ }
+
parentId = null;
item = _libraryManager.GetUserRootFolder();
}
@@ -438,6 +450,7 @@ public class ItemsController : BaseJellyfinApiController
MaxPremiereDate = maxPremiereDate?.ToUniversalTime(),
AudioLanguages = audioLanguages,
SubtitleLanguages = subtitleLanguages,
+ LinkedChildAncestorIds = linkedChildAncestorIds,
};
if (ids.Length != 0 || !string.IsNullOrWhiteSpace(searchTerm))