2014-03-01 15:34:27 -07:00
|
|
|
|
using MediaBrowser.Common.Net;
|
|
|
|
|
using MediaBrowser.Controller.Entities;
|
2013-06-23 10:48:30 -07:00
|
|
|
|
using MediaBrowser.Controller.Library;
|
2014-02-02 06:36:31 -07:00
|
|
|
|
using MediaBrowser.Model.Configuration;
|
2013-06-28 13:25:58 -07:00
|
|
|
|
using MediaBrowser.Model.Entities;
|
2013-10-30 14:33:27 -07:00
|
|
|
|
using MediaBrowser.Model.Providers;
|
2015-03-13 21:50:23 -07:00
|
|
|
|
using System;
|
2013-04-07 13:55:05 -07:00
|
|
|
|
using System.Collections.Generic;
|
2013-03-07 22:08:27 -07:00
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Threading;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace MediaBrowser.Controller.Providers
|
|
|
|
|
{
|
2013-06-23 10:48:30 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Interface IProviderManager
|
|
|
|
|
/// </summary>
|
2013-04-07 13:55:05 -07:00
|
|
|
|
public interface IProviderManager
|
2013-03-07 22:08:27 -07:00
|
|
|
|
{
|
2015-03-13 21:50:23 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Queues the refresh.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="itemId">The item identifier.</param>
|
|
|
|
|
/// <param name="options">The options.</param>
|
|
|
|
|
void QueueRefresh(Guid itemId, MetadataRefreshOptions options);
|
|
|
|
|
|
2015-03-14 08:38:16 -07: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);
|
|
|
|
|
|
2014-01-28 11:37:01 -07: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 08:38:16 -07:00
|
|
|
|
Task<ItemUpdateType> RefreshSingleItem(IHasMetadata item, MetadataRefreshOptions options, CancellationToken cancellationToken);
|
2014-01-28 11:37:01 -07:00
|
|
|
|
|
2013-03-07 22:08:27 -07:00
|
|
|
|
/// <summary>
|
2013-06-28 13:25:58 -07:00
|
|
|
|
/// Saves the image.
|
2013-03-07 22:08:27 -07:00
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="item">The item.</param>
|
2013-06-28 13:25:58 -07:00
|
|
|
|
/// <param name="url">The URL.</param>
|
|
|
|
|
/// <param name="type">The type.</param>
|
|
|
|
|
/// <param name="imageIndex">Index of the image.</param>
|
2013-03-07 22:08:27 -07:00
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task.</returns>
|
2017-02-04 14:22:55 -07:00
|
|
|
|
Task SaveImage(IHasImages item, string url, ImageType type, int? imageIndex, CancellationToken cancellationToken);
|
2013-03-07 22:08:27 -07:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
2013-06-28 13:25:58 -07:00
|
|
|
|
/// Saves the image.
|
2013-03-07 22:08:27 -07:00
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="item">The item.</param>
|
2013-06-28 13:25:58 -07:00
|
|
|
|
/// <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>
|
2013-03-07 22:08:27 -07:00
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
2013-06-28 13:25:58 -07:00
|
|
|
|
/// <returns>Task.</returns>
|
2014-02-15 15:42:06 -07:00
|
|
|
|
Task SaveImage(IHasImages item, Stream source, string mimeType, ImageType type, int? imageIndex, CancellationToken cancellationToken);
|
2013-03-07 22:08:27 -07:00
|
|
|
|
|
2014-10-19 20:04:45 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Saves the image.
|
|
|
|
|
/// </summary>
|
2015-04-08 08:45:30 -07:00
|
|
|
|
/// <returns>Task.</returns>
|
2016-10-17 09:35:29 -07:00
|
|
|
|
Task SaveImage(IHasImages item, string source, string mimeType, ImageType type, int? imageIndex, bool? saveLocallyWithMedia, CancellationToken cancellationToken);
|
2014-10-19 20:04:45 -07:00
|
|
|
|
|
2013-03-07 22:08:27 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Adds the metadata providers.
|
|
|
|
|
/// </summary>
|
2016-05-26 10:18:58 -07:00
|
|
|
|
void AddParts(IEnumerable<IImageProvider> imageProviders, IEnumerable<IMetadataService> metadataServices, IEnumerable<IMetadataProvider> metadataProviders,
|
2014-02-18 22:21:03 -07:00
|
|
|
|
IEnumerable<IMetadataSaver> savers,
|
2014-02-21 11:48:15 -07:00
|
|
|
|
IEnumerable<IExternalId> externalIds);
|
2013-10-30 14:33:27 -07:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the available remote images.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="item">The item.</param>
|
2014-02-11 20:46:27 -07:00
|
|
|
|
/// <param name="query">The query.</param>
|
2013-10-30 14:33:27 -07:00
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task{IEnumerable{RemoteImageInfo}}.</returns>
|
2014-02-11 20:46:27 -07:00
|
|
|
|
Task<IEnumerable<RemoteImageInfo>> GetAvailableRemoteImages(IHasImages item, RemoteImageQuery query, CancellationToken cancellationToken);
|
2013-10-31 18:48:14 -07:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the image providers.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="item">The item.</param>
|
2014-01-28 11:37:01 -07:00
|
|
|
|
/// <returns>IEnumerable{ImageProviderInfo}.</returns>
|
2014-02-09 14:11:11 -07:00
|
|
|
|
IEnumerable<ImageProviderInfo> GetRemoteImageProviderInfo(IHasImages item);
|
2014-02-02 06:36:31 -07:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets all metadata plugins.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns>IEnumerable{MetadataPlugin}.</returns>
|
|
|
|
|
IEnumerable<MetadataPluginSummary> GetAllMetadataPlugins();
|
|
|
|
|
|
2014-02-21 11:48:15 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the external urls.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="item">The item.</param>
|
|
|
|
|
/// <returns>IEnumerable{ExternalUrl}.</returns>
|
2016-05-28 23:03:09 -07:00
|
|
|
|
IEnumerable<ExternalUrl> GetExternalUrls(BaseItem item);
|
2014-02-21 11:48:15 -07:00
|
|
|
|
|
2014-02-21 14:44:10 -07: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 06:36:31 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Saves the metadata.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="item">The item.</param>
|
|
|
|
|
/// <param name="updateType">Type of the update.</param>
|
|
|
|
|
/// <returns>Task.</returns>
|
|
|
|
|
Task SaveMetadata(IHasMetadata item, ItemUpdateType updateType);
|
2014-02-09 16:08:01 -07:00
|
|
|
|
|
2014-09-26 19:28:13 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Saves the metadata.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="item">The item.</param>
|
|
|
|
|
/// <param name="updateType">Type of the update.</param>
|
|
|
|
|
/// <param name="savers">The savers.</param>
|
|
|
|
|
/// <returns>Task.</returns>
|
|
|
|
|
Task SaveMetadata(IHasMetadata item, ItemUpdateType updateType, IEnumerable<string> savers);
|
|
|
|
|
|
2014-02-09 16:08:01 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the metadata options.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="item">The item.</param>
|
|
|
|
|
/// <returns>MetadataOptions.</returns>
|
2014-02-10 21:55:01 -07:00
|
|
|
|
MetadataOptions GetMetadataOptions(IHasImages item);
|
2014-02-19 21:53:15 -07:00
|
|
|
|
|
|
|
|
|
/// <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 15:34:27 -07: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);
|
2013-03-07 22:08:27 -07:00
|
|
|
|
}
|
|
|
|
|
}
|