using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library;
using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Providers;
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
namespace MediaBrowser.Controller.Providers
{
///
/// Interface IProviderManager
///
public interface IProviderManager
{
///
/// Queues the refresh.
///
/// The item identifier.
/// The options.
void QueueRefresh(Guid itemId, MetadataRefreshOptions options);
///
/// Refreshes the full item.
///
/// The item.
/// The options.
/// The cancellation token.
/// Task.
Task RefreshFullItem(IHasMetadata item, MetadataRefreshOptions options, CancellationToken cancellationToken);
///
/// Refreshes the metadata.
///
/// The item.
/// The options.
/// The cancellation token.
/// Task.
Task RefreshSingleItem(IHasMetadata item, MetadataRefreshOptions options, CancellationToken cancellationToken);
///
/// Saves the image.
///
/// The item.
/// The URL.
/// The resource pool.
/// The type.
/// Index of the image.
/// The cancellation token.
/// Task.
Task SaveImage(IHasImages item, string url, SemaphoreSlim resourcePool, 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(IHasImages item, Stream source, string mimeType, ImageType type, int? imageIndex, CancellationToken cancellationToken);
///
/// Saves the image.
///
/// The item.
/// The source.
/// Type of the MIME.
/// The type.
/// Index of the image.
/// The internal cache key.
/// The cancellation token.
/// Task.
Task SaveImage(IHasImages item, Stream source, string mimeType, ImageType type, int? imageIndex, string internalCacheKey, CancellationToken cancellationToken);
///
/// Saves the image.
///
/// The item.
/// The source.
/// Type of the MIME.
/// The type.
/// Index of the image.
/// The internal cache key.
/// The cancellation token.
/// Task.
Task SaveImage(IHasImages item, string source, string mimeType, ImageType type, int? imageIndex, string internalCacheKey, CancellationToken cancellationToken);
///
/// 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(IHasImages item, RemoteImageQuery query, CancellationToken cancellationToken);
///
/// Gets the image providers.
///
/// The item.
/// IEnumerable{ImageProviderInfo}.
IEnumerable GetRemoteImageProviderInfo(IHasImages item);
///
/// Gets all metadata plugins.
///
/// IEnumerable{MetadataPlugin}.
IEnumerable 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.
/// Task.
Task SaveMetadata(IHasMetadata item, ItemUpdateType updateType);
///
/// Saves the metadata.
///
/// The item.
/// Type of the update.
/// The savers.
/// Task.
Task SaveMetadata(IHasMetadata item, ItemUpdateType updateType, IEnumerable savers);
///
/// Gets the metadata options.
///
/// The item.
/// MetadataOptions.
MetadataOptions GetMetadataOptions(IHasImages 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);
}
}