jellyfin-server/MediaBrowser.Controller/Providers/IProviderManager.cs

178 lines
7.2 KiB
C#
Raw Normal View History

2014-03-01 22:34:27 +00:00
using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library;
2014-02-02 13:36:31 +00:00
using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Entities;
2013-10-30 21:33:27 +00:00
using MediaBrowser.Model.Providers;
2015-03-14 04:50:23 +00:00
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
2017-06-23 16:04:45 +00:00
using MediaBrowser.Model.Events;
namespace MediaBrowser.Controller.Providers
{
/// <summary>
/// Interface IProviderManager
/// </summary>
public interface IProviderManager
{
2015-03-14 04:50:23 +00:00
/// <summary>
/// Queues the refresh.
/// </summary>
2017-04-30 02:37:51 +00:00
void QueueRefresh(Guid itemId, MetadataRefreshOptions options, RefreshPriority priority);
2015-03-14 04:50:23 +00:00
2015-03-14 15:38:16 +00:00
/// <summary>
/// Refreshes the full item.
/// </summary>
/// <param name="item">The item.</param>
/// <param name="options">The options.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
Task RefreshFullItem(IHasMetadata item, MetadataRefreshOptions options, CancellationToken cancellationToken);
2017-06-23 16:04:45 +00:00
/// <summary>
/// Refreshes the metadata.
/// </summary>
/// <param name="item">The item.</param>
/// <param name="options">The options.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
2015-03-14 15:38:16 +00:00
Task<ItemUpdateType> RefreshSingleItem(IHasMetadata item, MetadataRefreshOptions options, CancellationToken cancellationToken);
/// <summary>
/// Saves the image.
/// </summary>
/// <param name="item">The item.</param>
/// <param name="url">The URL.</param>
/// <param name="type">The type.</param>
/// <param name="imageIndex">Index of the image.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
2017-08-07 21:06:13 +00:00
Task SaveImage(IHasMetadata item, string url, ImageType type, int? imageIndex, CancellationToken cancellationToken);
/// <summary>
/// Saves the image.
/// </summary>
/// <param name="item">The item.</param>
/// <param name="source">The source.</param>
/// <param name="mimeType">Type of the MIME.</param>
/// <param name="type">The type.</param>
/// <param name="imageIndex">Index of the image.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
2017-08-07 21:06:13 +00:00
Task SaveImage(IHasMetadata item, Stream source, string mimeType, ImageType type, int? imageIndex, CancellationToken cancellationToken);
2014-10-20 03:04:45 +00:00
/// <summary>
/// Saves the image.
/// </summary>
2015-04-08 15:45:30 +00:00
/// <returns>Task.</returns>
2017-08-07 21:06:13 +00:00
Task SaveImage(IHasMetadata item, string source, string mimeType, ImageType type, int? imageIndex, bool? saveLocallyWithMedia, CancellationToken cancellationToken);
2017-06-23 16:04:45 +00:00
/// <summary>
/// Adds the metadata providers.
/// </summary>
2016-05-26 17:18:58 +00:00
void AddParts(IEnumerable<IImageProvider> imageProviders, IEnumerable<IMetadataService> metadataServices, IEnumerable<IMetadataProvider> metadataProviders,
2014-02-19 05:21:03 +00:00
IEnumerable<IMetadataSaver> savers,
2014-02-21 18:48:15 +00:00
IEnumerable<IExternalId> externalIds);
2013-10-30 21:33:27 +00:00
/// <summary>
/// Gets the available remote images.
/// </summary>
/// <param name="item">The item.</param>
2014-02-12 03:46:27 +00:00
/// <param name="query">The query.</param>
2013-10-30 21:33:27 +00:00
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task{IEnumerable{RemoteImageInfo}}.</returns>
2017-08-07 21:06:13 +00:00
Task<IEnumerable<RemoteImageInfo>> GetAvailableRemoteImages(IHasMetadata item, RemoteImageQuery query, CancellationToken cancellationToken);
/// <summary>
/// Gets the image providers.
/// </summary>
/// <param name="item">The item.</param>
/// <returns>IEnumerable{ImageProviderInfo}.</returns>
2017-08-07 21:06:13 +00:00
IEnumerable<ImageProviderInfo> GetRemoteImageProviderInfo(IHasMetadata item);
2014-02-02 13:36:31 +00:00
/// <summary>
/// Gets all metadata plugins.
/// </summary>
/// <returns>IEnumerable{MetadataPlugin}.</returns>
2017-08-19 19:43:35 +00:00
MetadataPluginSummary[] GetAllMetadataPlugins();
2014-02-02 13:36:31 +00:00
2014-02-21 18:48:15 +00:00
/// <summary>
/// Gets the external urls.
/// </summary>
/// <param name="item">The item.</param>
/// <returns>IEnumerable{ExternalUrl}.</returns>
2016-05-29 06:03:09 +00:00
IEnumerable<ExternalUrl> GetExternalUrls(BaseItem item);
2014-02-21 18:48:15 +00:00
2014-02-21 21:44:10 +00:00
/// <summary>
/// Gets the external identifier infos.
/// </summary>
/// <param name="item">The item.</param>
/// <returns>IEnumerable{ExternalIdInfo}.</returns>
IEnumerable<ExternalIdInfo> GetExternalIdInfos(IHasProviderIds item);
2014-02-02 13:36:31 +00:00
/// <summary>
/// Saves the metadata.
/// </summary>
/// <param name="item">The item.</param>
/// <param name="updateType">Type of the update.</param>
/// <returns>Task.</returns>
2017-10-03 18:39:37 +00:00
void SaveMetadata(IHasMetadata item, ItemUpdateType updateType);
/// <summary>
/// Saves the metadata.
/// </summary>
2017-10-03 18:39:37 +00:00
void SaveMetadata(IHasMetadata item, ItemUpdateType updateType, IEnumerable<string> savers);
2017-06-23 16:04:45 +00:00
/// <summary>
/// Gets the metadata options.
/// </summary>
/// <param name="item">The item.</param>
/// <returns>MetadataOptions.</returns>
2017-08-07 21:06:13 +00:00
MetadataOptions GetMetadataOptions(IHasMetadata item);
/// <summary>
/// Gets the remote search results.
/// </summary>
/// <typeparam name="TItemType">The type of the t item type.</typeparam>
/// <typeparam name="TLookupType">The type of the t lookup type.</typeparam>
/// <param name="searchInfo">The search information.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task{IEnumerable{SearchResult{``1}}}.</returns>
Task<IEnumerable<RemoteSearchResult>> GetRemoteSearchResults<TItemType, TLookupType>(
RemoteSearchQuery<TLookupType> searchInfo,
CancellationToken cancellationToken)
where TItemType : BaseItem, new()
where TLookupType : ItemLookupInfo;
2014-03-01 22:34:27 +00:00
/// <summary>
/// Gets the search image.
/// </summary>
/// <param name="providerName">Name of the provider.</param>
/// <param name="url">The URL.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task{HttpResponseInfo}.</returns>
Task<HttpResponseInfo> GetSearchImage(string providerName, string url, CancellationToken cancellationToken);
2017-06-23 16:04:45 +00:00
Dictionary<Guid, Guid> GetRefreshQueue();
void OnRefreshStart(BaseItem item);
void OnRefreshProgress(BaseItem item, double progress);
void OnRefreshComplete(BaseItem item);
double? GetRefreshProgress(Guid id);
event EventHandler<GenericEventArgs<BaseItem>> RefreshStarted;
event EventHandler<GenericEventArgs<BaseItem>> RefreshCompleted;
event EventHandler<GenericEventArgs<Tuple<BaseItem, double>>> RefreshProgress;
}
2017-04-30 02:37:51 +00:00
public enum RefreshPriority
{
High = 0,
Normal = 1,
Low = 2
}
}