#pragma warning disable CS1591
using System;
using System.Collections.Generic;
using System.IO;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using Jellyfin.Data.Events;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library;
using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Providers;
namespace MediaBrowser.Controller.Providers
{
///
/// Interface IProviderManager.
///
public interface IProviderManager
{
event EventHandler> RefreshStarted;
event EventHandler> RefreshCompleted;
event EventHandler>> RefreshProgress;
///
/// Queues the refresh.
///
void QueueRefresh(Guid itemId, MetadataRefreshOptions options, RefreshPriority priority);
///
/// Refreshes the full item.
///
/// The item.
/// The options.
/// The cancellation token.
/// Task.
Task RefreshFullItem(BaseItem item, MetadataRefreshOptions options, CancellationToken cancellationToken);
///
/// Refreshes the metadata.
///
/// The item.
/// The options.
/// The cancellation token.
/// Task.
Task RefreshSingleItem(BaseItem item, MetadataRefreshOptions options, CancellationToken cancellationToken);
///
/// Runs multiple metadata refreshes concurrently.
///
/// The action to run.
/// The cancellation token.
/// A representing the result of the asynchronous operation.
Task RunMetadataRefresh(Func action, CancellationToken cancellationToken);
///
/// Saves the image.
///
/// The item.
/// The URL.
/// The type.
/// Index of the image.
/// The cancellation token.
/// Task.
Task SaveImage(BaseItem item, string url, ImageType type, int? imageIndex, CancellationToken cancellationToken);
///
/// Saves the image.
///
/// The item.
/// The source.
/// Type of the MIME.
/// The type.
/// Index of the image.
/// The cancellation token.
/// Task.
Task SaveImage(BaseItem item, Stream source, string mimeType, ImageType type, int? imageIndex, CancellationToken cancellationToken);
///
/// Saves the image.
///
/// Task.
Task SaveImage(BaseItem item, string source, string mimeType, ImageType type, int? imageIndex, bool? saveLocallyWithMedia, CancellationToken cancellationToken);
Task SaveImage(Stream source, string mimeType, string path);
///
/// Adds the metadata providers.
///
void AddParts(IEnumerable imageProviders, IEnumerable metadataServices, IEnumerable metadataProviders,
IEnumerable savers,
IEnumerable externalIds);
///
/// Gets the available remote images.
///
/// The item.
/// The query.
/// The cancellation token.
/// Task{IEnumerable{RemoteImageInfo}}.
Task> GetAvailableRemoteImages(BaseItem item, RemoteImageQuery query, CancellationToken cancellationToken);
///
/// Gets the image providers.
///
/// The item.
/// IEnumerable{ImageProviderInfo}.
IEnumerable GetRemoteImageProviderInfo(BaseItem item);
///
/// Gets all metadata plugins.
///
/// IEnumerable{MetadataPlugin}.
MetadataPluginSummary[] GetAllMetadataPlugins();
///
/// Gets the external urls.
///
/// The item.
/// IEnumerable{ExternalUrl}.
IEnumerable GetExternalUrls(BaseItem item);
///
/// Gets the external identifier infos.
///
/// The item.
/// IEnumerable{ExternalIdInfo}.
IEnumerable GetExternalIdInfos(IHasProviderIds item);
///
/// Saves the metadata.
///
/// The item.
/// Type of the update.
void SaveMetadata(BaseItem item, ItemUpdateType updateType);
///
/// Saves the metadata.
///
/// The item.
/// Type of the update.
/// The metadata savers.
void SaveMetadata(BaseItem item, ItemUpdateType updateType, IEnumerable savers);
///
/// Gets the metadata options.
///
/// The item.
/// MetadataOptions.
MetadataOptions GetMetadataOptions(BaseItem item);
///
/// Gets the remote search results.
///
/// The type of the t item type.
/// The type of the t lookup type.
/// The search information.
/// The cancellation token.
/// Task{IEnumerable{SearchResult{``1}}}.
Task> GetRemoteSearchResults(
RemoteSearchQuery searchInfo,
CancellationToken cancellationToken)
where TItemType : BaseItem, new()
where TLookupType : ItemLookupInfo;
///
/// Gets the search image.
///
/// Name of the provider.
/// The URL.
/// The cancellation token.
/// Task{HttpResponseInfo}.
Task GetSearchImage(string providerName, string url, CancellationToken cancellationToken);
Dictionary GetRefreshQueue();
void OnRefreshStart(BaseItem item);
void OnRefreshProgress(BaseItem item, double progress);
void OnRefreshComplete(BaseItem item);
double? GetRefreshProgress(Guid id);
}
public enum RefreshPriority
{
High = 0,
Normal = 1,
Low = 2
}
}