perf(nextup): batch the user data reads the next episode selection makes
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful

Next Up walked every series in an unpaginated loop and read user data one
episode at a time, so the Home screen row cost two queries per series once the
cache was gone.

- read the played state of every candidate episode in one query
- read the versions the resume check and the last played date need in one query each
- default PrefetchedUserData on IUserBaseItemComparer so plugin comparers still compile
- cover the bounded query count and the plugin comparer with tests
- share one database across the replica tests
This commit is contained in:
2026-09-21 00:36:39 +10:00
parent a7919b9bac
commit 1c59e6afcb
5 changed files with 334 additions and 100 deletions
@@ -33,8 +33,13 @@ namespace MediaBrowser.Controller.Sorting
/// <summary>
/// Gets or sets user data for the items being sorted, keyed by item id, read once up front.
/// A comparer that does not store it reads its user data one item at a time instead.
/// </summary>
/// <value>The prefetched user data, or <c>null</c> when none was prefetched.</value>
IReadOnlyDictionary<Guid, UserItemData> PrefetchedUserData { get; set; }
IReadOnlyDictionary<Guid, UserItemData> PrefetchedUserData
{
get => null;
set { }
}
}
}