2013-04-07 20:55:05 +00:00
|
|
|
|
using MediaBrowser.Controller.Entities;
|
2013-06-23 17:48:30 +00:00
|
|
|
|
using MediaBrowser.Controller.Library;
|
2013-06-28 20:25:58 +00:00
|
|
|
|
using MediaBrowser.Model.Entities;
|
2013-10-30 21:33:27 +00:00
|
|
|
|
using MediaBrowser.Model.Providers;
|
2013-04-07 20:55:05 +00:00
|
|
|
|
using System.Collections.Generic;
|
2013-03-08 05:08:27 +00:00
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Threading;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace MediaBrowser.Controller.Providers
|
|
|
|
|
{
|
2013-06-23 17:48:30 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Interface IProviderManager
|
|
|
|
|
/// </summary>
|
2013-04-07 20:55:05 +00:00
|
|
|
|
public interface IProviderManager
|
2013-03-08 05:08:27 +00:00
|
|
|
|
{
|
2013-06-23 17:48:30 +00:00
|
|
|
|
/// <summary>
|
2013-06-28 20:25:58 +00:00
|
|
|
|
/// Executes the metadata providers.
|
2013-06-23 17:48:30 +00:00
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="item">The item.</param>
|
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
2013-06-28 20:25:58 +00:00
|
|
|
|
/// <param name="force">if set to <c>true</c> [force].</param>
|
|
|
|
|
/// <param name="allowSlowProviders">if set to <c>true</c> [allow slow providers].</param>
|
|
|
|
|
/// <returns>Task{System.Boolean}.</returns>
|
|
|
|
|
Task<ItemUpdateType?> ExecuteMetadataProviders(BaseItem item, CancellationToken cancellationToken, bool force = false, bool allowSlowProviders = true);
|
2013-06-23 17:48:30 +00:00
|
|
|
|
|
2013-03-08 05:08:27 +00:00
|
|
|
|
/// <summary>
|
2013-06-28 20:25:58 +00:00
|
|
|
|
/// Saves the image.
|
2013-03-08 05:08:27 +00:00
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="item">The item.</param>
|
2013-06-28 20:25:58 +00:00
|
|
|
|
/// <param name="url">The URL.</param>
|
|
|
|
|
/// <param name="resourcePool">The resource pool.</param>
|
|
|
|
|
/// <param name="type">The type.</param>
|
|
|
|
|
/// <param name="imageIndex">Index of the image.</param>
|
2013-03-08 05:08:27 +00:00
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task.</returns>
|
2013-06-28 20:25:58 +00:00
|
|
|
|
Task SaveImage(BaseItem item, string url, SemaphoreSlim resourcePool, ImageType type, int? imageIndex, CancellationToken cancellationToken);
|
2013-03-08 05:08:27 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
2013-06-28 20:25:58 +00:00
|
|
|
|
/// Saves the image.
|
2013-03-08 05:08:27 +00:00
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="item">The item.</param>
|
2013-06-28 20:25:58 +00: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-10-22 19:03:21 +00:00
|
|
|
|
/// <param name="sourceUrl">The source URL.</param>
|
2013-03-08 05:08:27 +00:00
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
2013-06-28 20:25:58 +00:00
|
|
|
|
/// <returns>Task.</returns>
|
2013-10-22 19:03:21 +00:00
|
|
|
|
Task SaveImage(BaseItem item, Stream source, string mimeType, ImageType type, int? imageIndex, string sourceUrl, CancellationToken cancellationToken);
|
2013-03-08 05:08:27 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Adds the metadata providers.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="providers">The providers.</param>
|
2013-10-30 21:33:27 +00:00
|
|
|
|
/// <param name="imageProviders">The image providers.</param>
|
|
|
|
|
void AddParts(IEnumerable<BaseMetadataProvider> providers, IEnumerable<IImageProvider> imageProviders);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the available remote images.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="item">The item.</param>
|
|
|
|
|
/// <param name="type">The type.</param>
|
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task{IEnumerable{RemoteImageInfo}}.</returns>
|
|
|
|
|
Task<IEnumerable<RemoteImageInfo>> GetAvailableRemoteImages(BaseItem item, ImageType type, CancellationToken cancellationToken);
|
2013-03-08 05:08:27 +00:00
|
|
|
|
}
|
|
|
|
|
}
|