aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Providers/IProviderManager.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2013-06-28 16:25:58 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2013-06-28 16:25:58 -0400
commit8a1b12b7d805ce35f4e10acf2294f355f47e75e3 (patch)
tree71fc6b154b3b4e335fe9af1a58fdb584042dd92a /MediaBrowser.Controller/Providers/IProviderManager.cs
parentac7d6256f460ce459a5b5c824e1b32d23e120901 (diff)
tightened up image saving to reduce knowledge of file names
Diffstat (limited to 'MediaBrowser.Controller/Providers/IProviderManager.cs')
-rw-r--r--MediaBrowser.Controller/Providers/IProviderManager.cs58
1 files changed, 21 insertions, 37 deletions
diff --git a/MediaBrowser.Controller/Providers/IProviderManager.cs b/MediaBrowser.Controller/Providers/IProviderManager.cs
index 643dbe1c2..6b8083b20 100644
--- a/MediaBrowser.Controller/Providers/IProviderManager.cs
+++ b/MediaBrowser.Controller/Providers/IProviderManager.cs
@@ -1,5 +1,6 @@
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library;
+using MediaBrowser.Model.Entities;
using System.Collections.Generic;
using System.IO;
using System.Threading;
@@ -12,64 +13,47 @@ namespace MediaBrowser.Controller.Providers
/// </summary>
public interface IProviderManager
{
- /// <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>
- /// <param name="saveLocally">if set to <c>true</c> [save locally].</param>
- /// <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>
- Task<string> DownloadAndSaveImage(BaseItem item, string source, string targetName, bool saveLocally, SemaphoreSlim resourcePool, CancellationToken cancellationToken);
+ Task<string> DownloadAndSaveImage(BaseItem item, string source, string targetName, bool saveLocally,
+ SemaphoreSlim resourcePool, CancellationToken cancellationToken);
/// <summary>
- /// Saves the image.
+ /// Executes the metadata providers.
/// </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>
- Task<string> SaveImage(BaseItem item, Stream source, string targetName, bool saveLocally, CancellationToken cancellationToken);
+ /// <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);
/// <summary>
- /// Saves to library filesystem.
+ /// Saves the image.
/// </summary>
/// <param name="item">The item.</param>
- /// <param name="path">The path.</param>
- /// <param name="dataToSave">The data to save.</param>
+ /// <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>
/// <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);
+ Task SaveImage(BaseItem item, string url, SemaphoreSlim resourcePool, ImageType type, int? imageIndex, CancellationToken cancellationToken);
/// <summary>
- /// Executes the metadata providers.
+ /// Saves the image.
/// </summary>
/// <param name="item">The item.</param>
+ /// <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>
/// <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<ItemUpdateType?> ExecuteMetadataProviders(BaseItem item, CancellationToken cancellationToken, bool force = false, bool allowSlowProviders = true);
+ /// <returns>Task.</returns>
+ Task SaveImage(BaseItem item, Stream source, string mimeType, ImageType type, int? imageIndex, CancellationToken cancellationToken);
/// <summary>
/// Adds the metadata providers.
/// </summary>
/// <param name="providers">The providers.</param>
void AddParts(IEnumerable<BaseMetadataProvider> providers);
-
- /// <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);
}
} \ No newline at end of file