IProviderManager.cs 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. /// <summary>
  16. /// Executes the metadata providers.
  17. /// </summary>
  18. /// <param name="item">The item.</param>
  19. /// <param name="cancellationToken">The cancellation token.</param>
  20. /// <param name="force">if set to <c>true</c> [force].</param>
  21. /// <param name="allowSlowProviders">if set to <c>true</c> [allow slow providers].</param>
  22. /// <returns>Task{System.Boolean}.</returns>
  23. Task<ItemUpdateType?> ExecuteMetadataProviders(BaseItem item, CancellationToken cancellationToken, bool force = false, bool allowSlowProviders = true);
  24. /// <summary>
  25. /// Saves the image.
  26. /// </summary>
  27. /// <param name="item">The item.</param>
  28. /// <param name="url">The URL.</param>
  29. /// <param name="resourcePool">The resource pool.</param>
  30. /// <param name="type">The type.</param>
  31. /// <param name="imageIndex">Index of the image.</param>
  32. /// <param name="cancellationToken">The cancellation token.</param>
  33. /// <returns>Task.</returns>
  34. Task SaveImage(BaseItem item, string url, SemaphoreSlim resourcePool, ImageType type, int? imageIndex, CancellationToken cancellationToken);
  35. /// <summary>
  36. /// Saves the image.
  37. /// </summary>
  38. /// <param name="item">The item.</param>
  39. /// <param name="source">The source.</param>
  40. /// <param name="mimeType">Type of the MIME.</param>
  41. /// <param name="type">The type.</param>
  42. /// <param name="imageIndex">Index of the image.</param>
  43. /// <param name="sourceUrl">The source URL.</param>
  44. /// <param name="cancellationToken">The cancellation token.</param>
  45. /// <returns>Task.</returns>
  46. Task SaveImage(BaseItem item, Stream source, string mimeType, ImageType type, int? imageIndex, string sourceUrl, CancellationToken cancellationToken);
  47. /// <summary>
  48. /// Adds the metadata providers.
  49. /// </summary>
  50. /// <param name="providers">The providers.</param>
  51. void AddParts(IEnumerable<BaseMetadataProvider> providers);
  52. }
  53. }