diff options
| author | Shadowghost <Ghost_of_Stone@web.de> | 2026-02-09 00:45:48 +0100 |
|---|---|---|
| committer | Shadowghost <Ghost_of_Stone@web.de> | 2026-02-09 00:45:48 +0100 |
| commit | edc6caf255da2cb5fd5aef51d58a168ae0f39cb3 (patch) | |
| tree | aae4cf803fb614d66744eecd4e0d6bbd622952a0 /Jellyfin.Server.Implementations/Item | |
| parent | 0a99a78ddcb81498bad84fccaa22f6d3ff74d031 (diff) | |
Cleanup and fix version ordering
Diffstat (limited to 'Jellyfin.Server.Implementations/Item')
| -rw-r--r-- | Jellyfin.Server.Implementations/Item/BaseItemRepository.cs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs b/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs index c962979b17..46564b24cb 100644 --- a/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs +++ b/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs @@ -1719,6 +1719,7 @@ public sealed class BaseItemRepository : []; // Add or update LinkedChildren entries + int sortOrder = 0; foreach (var (childId, childType) in newLinkedChildren) { if (!existingChildIds.Contains(childId)) @@ -1739,14 +1740,17 @@ public sealed class BaseItemRepository ParentId = video.Id, ChildId = childId, ChildType = (DbLinkedChildType)childType, - SortOrder = null + SortOrder = sortOrder }); } else { existingLink.ChildType = (DbLinkedChildType)childType; + existingLink.SortOrder = sortOrder; existingLinkedChildren.Remove(existingLink); } + + sortOrder++; } // Remove orphaned alternate version links and their items @@ -3953,6 +3957,7 @@ public sealed class BaseItemRepository } return query + .OrderBy(lc => lc.SortOrder) .Select(lc => lc.ChildId) .ToList(); } |
