mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-06 14:22:55 +01:00
Fix performance
This commit is contained in:
@@ -50,9 +50,10 @@ public sealed class AlternateVersionQueryTranslationTests : IDisposable
|
||||
{
|
||||
// Mirrors the resumable filter in BaseItemRepository.TranslateQuery: progress on any
|
||||
// version coalesces onto the primary's id.
|
||||
var resumableMovieIds = ctx.BaseItems
|
||||
.Where(bi => bi.UserData!.Any(ud => ud.UserId == userId && ud.PlaybackPositionTicks > 0))
|
||||
.Select(bi => bi.PrimaryVersionId ?? bi.Id);
|
||||
var inProgress = ctx.UserData
|
||||
.Where(ud => ud.UserId == userId && ud.PlaybackPositionTicks > 0);
|
||||
var resumableMovieIds = inProgress
|
||||
.Join(ctx.BaseItems, ud => ud.ItemId, bi => bi.Id, (ud, bi) => bi.PrimaryVersionId ?? bi.Id);
|
||||
|
||||
// Scope to the seeded items; EnsureCreated also seeds a placeholder row.
|
||||
var seededIds = new[] { primaryId, otherId };
|
||||
|
||||
Reference in New Issue
Block a user