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 metadata.
///
/// The item.
/// The options.
/// The cancellation token.
/// Task.
Task RefreshMetadata(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);
///
/// Adds the metadata providers.
///
/// The image providers.
/// The metadata services.
/// The identity providers.
/// The identity converters.
/// The metadata providers.
/// The savers.
/// The image savers.
/// The external ids.
void AddParts(IEnumerable imageProviders, IEnumerable metadataServices, IEnumerable identityProviders, IEnumerable identityConverters, IEnumerable metadataProviders,
IEnumerable savers,
IEnumerable imageSavers,
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(IHasProviderIds 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);
///
/// Gets the item identity providers.
///
/// The type of the t lookup information.
/// The type of the t identity.
/// IEnumerable<IItemIdentityProvider<TLookupInfo, TIdentity>>.
IEnumerable> GetItemIdentityProviders()
where TLookupInfo : ItemLookupInfo
where TIdentity : IItemIdentity;
///
/// Gets the item identity converters.
///
/// The type of the t identity.
/// IEnumerable<IItemIdentityConverter<TIdentity>>.
IEnumerable> GetItemIdentityConverters()
where TIdentity : IItemIdentity;
}
}