IProviderManager.cs 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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="resourcePool">The resource pool.</param>
  17. /// <param name="cancellationToken">The cancellation token.</param>
  18. /// <returns>Task{System.String}.</returns>
  19. /// <exception cref="System.ArgumentNullException">item</exception>
  20. Task<string> DownloadAndSaveImage(BaseItem item, string source, string targetName, SemaphoreSlim resourcePool, CancellationToken cancellationToken);
  21. /// <summary>
  22. /// Saves to library filesystem.
  23. /// </summary>
  24. /// <param name="item">The item.</param>
  25. /// <param name="path">The path.</param>
  26. /// <param name="dataToSave">The data to save.</param>
  27. /// <param name="cancellationToken">The cancellation token.</param>
  28. /// <returns>Task.</returns>
  29. /// <exception cref="System.ArgumentNullException"></exception>
  30. Task SaveToLibraryFilesystem(BaseItem item, string path, Stream dataToSave, CancellationToken cancellationToken);
  31. /// <summary>
  32. /// Executes the metadata providers.
  33. /// </summary>
  34. /// <param name="item">The item.</param>
  35. /// <param name="cancellationToken">The cancellation token.</param>
  36. /// <param name="force">if set to <c>true</c> [force].</param>
  37. /// <param name="allowSlowProviders">if set to <c>true</c> [allow slow providers].</param>
  38. /// <returns>Task{System.Boolean}.</returns>
  39. Task<bool> ExecuteMetadataProviders(BaseItem item, CancellationToken cancellationToken, bool force = false, bool allowSlowProviders = true);
  40. /// <summary>
  41. /// Adds the metadata providers.
  42. /// </summary>
  43. /// <param name="providers">The providers.</param>
  44. void AddMetadataProviders(IEnumerable<BaseMetadataProvider> providers);
  45. }
  46. }