diff options
| author | Shadowghost <Ghost_of_Stone@web.de> | 2026-02-04 19:16:55 +0100 |
|---|---|---|
| committer | Shadowghost <Ghost_of_Stone@web.de> | 2026-02-04 19:19:31 +0100 |
| commit | aedd2b04a2687adfcc52db96aa3fb7b2ad94fdcc (patch) | |
| tree | 06268414bdeb61cc40fa15a0964e4c3698708295 /Jellyfin.Server.Implementations/Item/BaseItemRepository.cs | |
| parent | 98b561d62cc978ba805b9e5dadeda9c995c40cb1 (diff) | |
Fix alternative Versions and prevent over fetching
Diffstat (limited to 'Jellyfin.Server.Implementations/Item/BaseItemRepository.cs')
| -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 415f2b99cd..b154592e6e 100644 --- a/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs +++ b/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs @@ -983,7 +983,7 @@ public sealed class BaseItemRepository BaseItemKind.Video, BaseItemKind.Movie }; - if (filter.IncludeItemTypes.Length == 0 || filter.IncludeItemTypes.Any(linkedChildTypes.Contains)) + if (filter.IncludeItemTypes.Length > 0 && filter.IncludeItemTypes.Any(linkedChildTypes.Contains)) { dbQuery = dbQuery.Include(e => e.LinkedChildEntities); } @@ -1399,6 +1399,10 @@ public sealed class BaseItemRepository } } + // This is necessary because LocalAlternateVersions resolution queries the database by path, + // and newly imported alternate version items need to exist before we can link them + context.SaveChanges(); + var folderIds = tuples .Where(t => t.Item is Folder) .Select(t => t.Item.Id) @@ -1603,6 +1607,7 @@ public sealed class BaseItemRepository } } + // Phase 2 commit: Save LinkedChildren changes context.SaveChanges(); transaction.Commit(); } |
