mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-29 20:08:27 +01:00
Fix movie recommendations
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
|
||||
namespace MediaBrowser.Controller.Library;
|
||||
|
||||
/// <summary>
|
||||
/// A local similar items provider that supports batch queries across multiple source items.
|
||||
/// Implementations share access filtering and entity loading across all sources for better performance.
|
||||
/// </summary>
|
||||
public interface IBatchLocalSimilarItemsProvider : ISimilarItemsProvider
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets similar items for multiple source items in a single batch.
|
||||
/// </summary>
|
||||
/// <param name="sourceItems">The source items to find similar items for.</param>
|
||||
/// <param name="query">The query options.</param>
|
||||
/// <returns>Per-source-item results keyed by source item ID.</returns>
|
||||
Task<Dictionary<Guid, IReadOnlyList<BaseItem>>> GetBatchSimilarItemsAsync(
|
||||
IReadOnlyList<BaseItem> sourceItems,
|
||||
SimilarItemsQuery query);
|
||||
}
|
||||
@@ -597,6 +597,15 @@ namespace MediaBrowser.Controller.Library
|
||||
/// <returns>List<System.String>.</returns>
|
||||
IReadOnlyList<string> GetPeopleNames(InternalPeopleQuery query);
|
||||
|
||||
/// <summary>
|
||||
/// Gets distinct people names for multiple items.
|
||||
/// </summary>
|
||||
/// <param name="itemIds">The item IDs.</param>
|
||||
/// <param name="personTypes">The person types to include.</param>
|
||||
/// <param name="limit">Maximum number of names.</param>
|
||||
/// <returns>The distinct people names.</returns>
|
||||
IReadOnlyList<string> GetPeopleNamesByItems(IReadOnlyList<Guid> itemIds, IReadOnlyList<string> personTypes, int limit);
|
||||
|
||||
/// <summary>
|
||||
/// Queries the items.
|
||||
/// </summary>
|
||||
|
||||
@@ -47,4 +47,14 @@ public interface ISimilarItemsManager
|
||||
int? limit,
|
||||
LibraryOptions? libraryOptions,
|
||||
CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Gets similar items for multiple source items in a single batch.
|
||||
/// </summary>
|
||||
/// <param name="sourceItems">The source items to find similar items for.</param>
|
||||
/// <param name="query">The query options.</param>
|
||||
/// <returns>Per-source-item results keyed by source item ID.</returns>
|
||||
Task<Dictionary<Guid, IReadOnlyList<BaseItem>>> GetBatchSimilarItemsAsync(
|
||||
IReadOnlyList<BaseItem> sourceItems,
|
||||
SimilarItemsQuery query);
|
||||
}
|
||||
|
||||
@@ -32,4 +32,13 @@ public interface IPeopleRepository
|
||||
/// <param name="filter">The query.</param>
|
||||
/// <returns>The list of people names matching the filter.</returns>
|
||||
IReadOnlyList<string> GetPeopleNames(InternalPeopleQuery filter);
|
||||
|
||||
/// <summary>
|
||||
/// Gets distinct people names for multiple items efficiently by querying from the mapping table.
|
||||
/// </summary>
|
||||
/// <param name="itemIds">The item IDs to get people for.</param>
|
||||
/// <param name="personTypes">The person types to include (e.g. "Actor", "Director").</param>
|
||||
/// <param name="limit">Maximum number of names to return.</param>
|
||||
/// <returns>The distinct people names.</returns>
|
||||
IReadOnlyList<string> GetPeopleNamesByItems(IReadOnlyList<Guid> itemIds, IReadOnlyList<string> personTypes, int limit);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user