From 4ebce3907062ade1937440628eebd665440b338d Mon Sep 17 00:00:00 2001 From: Shadowghost Date: Sun, 3 May 2026 23:43:01 +0200 Subject: Implement Similarity providers --- .../Library/ISimilarItemsManager.cs | 50 ++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 MediaBrowser.Controller/Library/ISimilarItemsManager.cs (limited to 'MediaBrowser.Controller/Library/ISimilarItemsManager.cs') diff --git a/MediaBrowser.Controller/Library/ISimilarItemsManager.cs b/MediaBrowser.Controller/Library/ISimilarItemsManager.cs new file mode 100644 index 0000000000..0ced6f71ee --- /dev/null +++ b/MediaBrowser.Controller/Library/ISimilarItemsManager.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Jellyfin.Database.Implementations.Entities; +using MediaBrowser.Controller.Dto; +using MediaBrowser.Controller.Entities; +using MediaBrowser.Model.Configuration; + +namespace MediaBrowser.Controller.Library; + +/// +/// Interface for managing similar items providers and operations. +/// +public interface ISimilarItemsManager +{ + /// + /// Registers similar items providers discovered through dependency injection. + /// + /// The similar items providers to register. + void AddParts(IEnumerable providers); + + /// + /// Gets the similar items providers for a specific item type. + /// + /// The item type. + /// The list of similar items providers for that type. + IReadOnlyList GetSimilarItemsProviders() + where T : BaseItem; + + /// + /// Gets similar items for the specified item. + /// + /// The source item to find similar items for. + /// Artist IDs to exclude from results. + /// The user context. + /// The DTO options. + /// Maximum number of results. + /// The library options for provider configuration. + /// The cancellation token. + /// The list of similar items. + Task> GetSimilarItemsAsync( + BaseItem item, + IReadOnlyList excludeArtistIds, + User? user, + DtoOptions dtoOptions, + int? limit, + LibraryOptions? libraryOptions, + CancellationToken cancellationToken); +} -- cgit v1.2.3