IProviderManager.cs 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. using MediaBrowser.Controller.Entities;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Threading;
  5. using System.Threading.Tasks;
  6. namespace MediaBrowser.Controller.Providers
  7. {
  8. public interface IProviderManager
  9. {
  10. /// <summary>
  11. /// Downloads the and save image.
  12. /// </summary>
  13. /// <param name="item">The item.</param>
  14. /// <param name="source">The source.</param>
  15. /// <param name="targetName">Name of the target.</param>
  16. /// <param name="saveLocally">if set to <c>true</c> [save locally].</param>
  17. /// <param name="resourcePool">The resource pool.</param>
  18. /// <param name="cancellationToken">The cancellation token.</param>
  19. /// <returns>Task{System.String}.</returns>
  20. /// <exception cref="System.ArgumentNullException">item</exception>
  21. Task<string> DownloadAndSaveImage(BaseItem item, string source, string targetName, bool saveLocally, SemaphoreSlim resourcePool, CancellationToken cancellationToken);
  22. /// <summary>
  23. /// Saves to library filesystem.
  24. /// </summary>
  25. /// <param name="item">The item.</param>
  26. /// <param name="path">The path.</param>
  27. /// <param name="dataToSave">The data to save.</param>
  28. /// <param name="cancellationToken">The cancellation token.</param>
  29. /// <returns>Task.</returns>
  30. /// <exception cref="System.ArgumentNullException"></exception>
  31. Task SaveToLibraryFilesystem(BaseItem item, string path, Stream dataToSave, CancellationToken cancellationToken);
  32. /// <summary>
  33. /// Executes the metadata providers.
  34. /// </summary>
  35. /// <param name="item">The item.</param>
  36. /// <param name="cancellationToken">The cancellation token.</param>
  37. /// <param name="force">if set to <c>true</c> [force].</param>
  38. /// <param name="allowSlowProviders">if set to <c>true</c> [allow slow providers].</param>
  39. /// <returns>Task{System.Boolean}.</returns>
  40. Task<bool> ExecuteMetadataProviders(BaseItem item, CancellationToken cancellationToken, bool force = false, bool allowSlowProviders = true);
  41. /// <summary>
  42. /// Adds the metadata providers.
  43. /// </summary>
  44. /// <param name="providers">The providers.</param>
  45. void AddMetadataProviders(IEnumerable<BaseMetadataProvider> providers);
  46. }
  47. }