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-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
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Downloads the and save image.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="item">The item.</param>
|
|
|
|
|
/// <param name="source">The source.</param>
|
|
|
|
|
/// <param name="targetName">Name of the target.</param>
|
2013-04-22 04:38:03 +00:00
|
|
|
|
/// <param name="saveLocally">if set to <c>true</c> [save locally].</param>
|
2013-03-08 05:08:27 +00:00
|
|
|
|
/// <param name="resourcePool">The resource pool.</param>
|
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task{System.String}.</returns>
|
|
|
|
|
/// <exception cref="System.ArgumentNullException">item</exception>
|
2013-04-22 04:38:03 +00:00
|
|
|
|
Task<string> DownloadAndSaveImage(BaseItem item, string source, string targetName, bool saveLocally, SemaphoreSlim resourcePool, CancellationToken cancellationToken);
|
2013-03-08 05:08:27 +00:00
|
|
|
|
|
2013-06-23 17:48:30 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Saves the image.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="item">The item.</param>
|
|
|
|
|
/// <param name="source">The source.</param>
|
|
|
|
|
/// <param name="targetName">Name of the target.</param>
|
|
|
|
|
/// <param name="saveLocally">if set to <c>true</c> [save locally].</param>
|
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task{System.String}.</returns>
|
2013-05-19 18:42:58 +00:00
|
|
|
|
Task<string> SaveImage(BaseItem item, Stream source, string targetName, bool saveLocally, CancellationToken cancellationToken);
|
2013-06-23 17:48:30 +00:00
|
|
|
|
|
2013-03-08 05:08:27 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Saves to library filesystem.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="item">The item.</param>
|
|
|
|
|
/// <param name="path">The path.</param>
|
|
|
|
|
/// <param name="dataToSave">The data to save.</param>
|
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task.</returns>
|
|
|
|
|
/// <exception cref="System.ArgumentNullException"></exception>
|
|
|
|
|
Task SaveToLibraryFilesystem(BaseItem item, string path, Stream dataToSave, CancellationToken cancellationToken);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Executes the metadata providers.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="item">The item.</param>
|
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <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<bool> ExecuteMetadataProviders(BaseItem item, CancellationToken cancellationToken, bool force = false, bool allowSlowProviders = true);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Adds the metadata providers.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="providers">The providers.</param>
|
2013-06-23 17:48:30 +00:00
|
|
|
|
/// <param name="savers">The savers.</param>
|
|
|
|
|
void AddParts(IEnumerable<BaseMetadataProvider> providers,
|
|
|
|
|
IEnumerable<IMetadataSaver> savers);
|
2013-05-05 04:49:49 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the save path.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="item">The item.</param>
|
|
|
|
|
/// <param name="targetFileName">Name of the target file.</param>
|
|
|
|
|
/// <param name="saveLocally">if set to <c>true</c> [save locally].</param>
|
|
|
|
|
/// <returns>System.String.</returns>
|
|
|
|
|
string GetSavePath(BaseItem item, string targetFileName, bool saveLocally);
|
2013-03-08 05:08:27 +00:00
|
|
|
|
}
|
|
|
|
|
}
|