IProviderManager.cs 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. using MediaBrowser.Controller.Entities;
  2. using MediaBrowser.Controller.Library;
  3. using MediaBrowser.Model.Entities;
  4. using System.Collections.Generic;
  5. using System.IO;
  6. using System.Threading;
  7. using System.Threading.Tasks;
  8. namespace MediaBrowser.Controller.Providers
  9. {
  10. /// <summary>
  11. /// Interface IProviderManager
  12. /// </summary>
  13. public interface IProviderManager
  14. {
  15. Task<string> DownloadAndSaveImage(BaseItem item, string source, string targetName, bool saveLocally,
  16. SemaphoreSlim resourcePool, CancellationToken cancellationToken);
  17. /// <summary>
  18. /// Executes the metadata providers.
  19. /// </summary>
  20. /// <param name="item">The item.</param>
  21. /// <param name="cancellationToken">The cancellation token.</param>
  22. /// <param name="force">if set to <c>true</c> [force].</param>
  23. /// <param name="allowSlowProviders">if set to <c>true</c> [allow slow providers].</param>
  24. /// <returns>Task{System.Boolean}.</returns>
  25. Task<ItemUpdateType?> ExecuteMetadataProviders(BaseItem item, CancellationToken cancellationToken, bool force = false, bool allowSlowProviders = true);
  26. /// <summary>
  27. /// Saves the image.
  28. /// </summary>
  29. /// <param name="item">The item.</param>
  30. /// <param name="url">The URL.</param>
  31. /// <param name="resourcePool">The resource pool.</param>
  32. /// <param name="type">The type.</param>
  33. /// <param name="imageIndex">Index of the image.</param>
  34. /// <param name="cancellationToken">The cancellation token.</param>
  35. /// <returns>Task.</returns>
  36. Task SaveImage(BaseItem item, string url, SemaphoreSlim resourcePool, ImageType type, int? imageIndex, CancellationToken cancellationToken);
  37. /// <summary>
  38. /// Saves the image.
  39. /// </summary>
  40. /// <param name="item">The item.</param>
  41. /// <param name="source">The source.</param>
  42. /// <param name="mimeType">Type of the MIME.</param>
  43. /// <param name="type">The type.</param>
  44. /// <param name="imageIndex">Index of the image.</param>
  45. /// <param name="cancellationToken">The cancellation token.</param>
  46. /// <returns>Task.</returns>
  47. Task SaveImage(BaseItem item, Stream source, string mimeType, ImageType type, int? imageIndex, CancellationToken cancellationToken);
  48. /// <summary>
  49. /// Adds the metadata providers.
  50. /// </summary>
  51. /// <param name="providers">The providers.</param>
  52. void AddParts(IEnumerable<BaseMetadataProvider> providers);
  53. }
  54. }