diff options
| author | Shadowghost <Ghost_of_Stone@web.de> | 2026-05-03 23:33:56 +0200 |
|---|---|---|
| committer | Shadowghost <Ghost_of_Stone@web.de> | 2026-05-04 01:55:07 +0200 |
| commit | 07a802d8fa93460c9f2a7f42da7a1f14a893a322 (patch) | |
| tree | 61b6cf30ba21f34ebd98f9f5a7ed296a81c75f0a /MediaBrowser.Controller/Library/ISearchProvider.cs | |
| parent | 622947e37425f3620432995cde5d4a0809d91694 (diff) | |
Implement search providers
Diffstat (limited to 'MediaBrowser.Controller/Library/ISearchProvider.cs')
| -rw-r--r-- | MediaBrowser.Controller/Library/ISearchProvider.cs | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/MediaBrowser.Controller/Library/ISearchProvider.cs b/MediaBrowser.Controller/Library/ISearchProvider.cs new file mode 100644 index 0000000000..3b300ed38b --- /dev/null +++ b/MediaBrowser.Controller/Library/ISearchProvider.cs @@ -0,0 +1,44 @@ +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using MediaBrowser.Model.Configuration; + +namespace MediaBrowser.Controller.Library; + +/// <summary> +/// Interface for search providers. +/// </summary> +public interface ISearchProvider +{ + /// <summary> + /// Gets the name of the provider. + /// </summary> + string Name { get; } + + /// <summary> + /// Gets the type of the provider. + /// </summary> + MetadataPluginType Type { get; } + + /// <summary> + /// Gets the priority of the provider. Lower values execute first. + /// </summary> + int Priority { get; } + + /// <summary> + /// Searches for items matching the query. + /// </summary> + /// <param name="query">The search query.</param> + /// <param name="cancellationToken">Cancellation token.</param> + /// <returns>Ranked list of candidate item IDs with scores.</returns> + Task<IReadOnlyList<SearchResult>> SearchAsync( + SearchProviderQuery query, + CancellationToken cancellationToken); + + /// <summary> + /// Determines whether this provider can handle the given query. + /// </summary> + /// <param name="query">The search query to evaluate.</param> + /// <returns>True if this provider can search for the query; otherwise, false.</returns> + bool CanSearch(SearchProviderQuery query); +} |
