1c59e6afcb
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
46 lines
1.4 KiB
C#
46 lines
1.4 KiB
C#
#nullable disable
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using Jellyfin.Database.Implementations.Entities;
|
|
using MediaBrowser.Controller.Entities;
|
|
using MediaBrowser.Controller.Library;
|
|
|
|
namespace MediaBrowser.Controller.Sorting
|
|
{
|
|
/// <summary>
|
|
/// Represents a BaseItem comparer that requires a User to perform its comparison.
|
|
/// </summary>
|
|
public interface IUserBaseItemComparer : IBaseItemComparer
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets the user.
|
|
/// </summary>
|
|
/// <value>The user.</value>
|
|
User User { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the user manager.
|
|
/// </summary>
|
|
/// <value>The user manager.</value>
|
|
IUserManager UserManager { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the user data repository.
|
|
/// </summary>
|
|
/// <value>The user data repository.</value>
|
|
IUserDataManager UserDataManager { get; set; }
|
|
|
|
/// <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 => null;
|
|
set { }
|
|
}
|
|
}
|
|
}
|