aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server.Implementations
diff options
context:
space:
mode:
authorShadowghost <Shadowghost@users.noreply.github.com>2026-09-15 11:15:49 -0400
committerCody Robibero <cody@robibe.ro>2026-09-15 11:15:49 -0400
commita2aa3d96d2a75b01f94354b541fe890b78e7c8bd (patch)
treee6e60d6eb900b74f59c82dcef4fdd7690a8bfe9f /Jellyfin.Server.Implementations
parent51abf6f503dae58428f3558e77805f2937335d8f (diff)
Backport pull request #17884 from jellyfin/release-12.z
Release a folder's children once its subtree has been scanned Original-merge: 2f2adae7d99537e53417f6d92aa3d40345a17b99 Merged-by: crobibero <cody@robibe.ro> Backported-by: Cody Robibero <cody@robibe.ro>
Diffstat (limited to 'Jellyfin.Server.Implementations')
-rw-r--r--Jellyfin.Server.Implementations/Item/BaseItemMapper.cs36
1 files changed, 35 insertions, 1 deletions
diff --git a/Jellyfin.Server.Implementations/Item/BaseItemMapper.cs b/Jellyfin.Server.Implementations/Item/BaseItemMapper.cs
index c2cb644c59..6405c8c45d 100644
--- a/Jellyfin.Server.Implementations/Item/BaseItemMapper.cs
+++ b/Jellyfin.Server.Implementations/Item/BaseItemMapper.cs
@@ -34,6 +34,40 @@ public static class BaseItemMapper
/// </summary>
private static readonly ConcurrentDictionary<string, Type?> _typeMap = new ConcurrentDictionary<string, Type?>();
+ private static UserData[] DetachUserData(BaseItemEntity entity)
+ {
+ if (entity.UserData is null || entity.UserData.Count == 0)
+ {
+ return [];
+ }
+
+ var detached = new UserData[entity.UserData.Count];
+ var index = 0;
+ foreach (var userData in entity.UserData)
+ {
+ detached[index++] = new UserData
+ {
+ ItemId = userData.ItemId,
+ Item = null,
+ UserId = userData.UserId,
+ User = null,
+ CustomDataKey = userData.CustomDataKey,
+ Rating = userData.Rating,
+ PlaybackPositionTicks = userData.PlaybackPositionTicks,
+ PlayCount = userData.PlayCount,
+ IsFavorite = userData.IsFavorite,
+ LastPlayedDate = userData.LastPlayedDate,
+ Played = userData.Played,
+ AudioStreamIndex = userData.AudioStreamIndex,
+ SubtitleStreamIndex = userData.SubtitleStreamIndex,
+ Likes = userData.Likes,
+ RetentionDate = userData.RetentionDate
+ };
+ }
+
+ return detached;
+ }
+
/// <summary>
/// Maps a Entity to the DTO.
/// </summary>
@@ -87,7 +121,7 @@ public static class BaseItemMapper
dto.OwnerId = entity.OwnerId ?? Guid.Empty;
dto.Width = entity.Width.GetValueOrDefault();
dto.Height = entity.Height.GetValueOrDefault();
- dto.UserData = entity.UserData;
+ dto.UserData = DetachUserData(entity);
if (entity.Provider is not null)
{