IProviderManager.cs 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. using MediaBrowser.Controller.Entities;
  2. using MediaBrowser.Controller.Library;
  3. using MediaBrowser.Model.Entities;
  4. using MediaBrowser.Model.Providers;
  5. using System.Collections.Generic;
  6. using System.IO;
  7. using System.Threading;
  8. using System.Threading.Tasks;
  9. namespace MediaBrowser.Controller.Providers
  10. {
  11. /// <summary>
  12. /// Interface IProviderManager
  13. /// </summary>
  14. public interface IProviderManager
  15. {
  16. /// <summary>
  17. /// Executes the metadata providers.
  18. /// </summary>
  19. /// <param name="item">The item.</param>
  20. /// <param name="cancellationToken">The cancellation token.</param>
  21. /// <param name="force">if set to <c>true</c> [force].</param>
  22. /// <param name="allowSlowProviders">if set to <c>true</c> [allow slow providers].</param>
  23. /// <returns>Task{System.Boolean}.</returns>
  24. Task<ItemUpdateType?> ExecuteMetadataProviders(BaseItem item, CancellationToken cancellationToken, bool force = false, bool allowSlowProviders = true);
  25. /// <summary>
  26. /// Saves the image.
  27. /// </summary>
  28. /// <param name="item">The item.</param>
  29. /// <param name="url">The URL.</param>
  30. /// <param name="resourcePool">The resource pool.</param>
  31. /// <param name="type">The type.</param>
  32. /// <param name="imageIndex">Index of the image.</param>
  33. /// <param name="cancellationToken">The cancellation token.</param>
  34. /// <returns>Task.</returns>
  35. Task SaveImage(BaseItem item, string url, SemaphoreSlim resourcePool, ImageType type, int? imageIndex, CancellationToken cancellationToken);
  36. /// <summary>
  37. /// Saves the image.
  38. /// </summary>
  39. /// <param name="item">The item.</param>
  40. /// <param name="source">The source.</param>
  41. /// <param name="mimeType">Type of the MIME.</param>
  42. /// <param name="type">The type.</param>
  43. /// <param name="imageIndex">Index of the image.</param>
  44. /// <param name="sourceUrl">The source URL.</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, string sourceUrl, CancellationToken cancellationToken);
  48. /// <summary>
  49. /// Adds the metadata providers.
  50. /// </summary>
  51. /// <param name="providers">The providers.</param>
  52. /// <param name="imageProviders">The image providers.</param>
  53. void AddParts(IEnumerable<BaseMetadataProvider> providers, IEnumerable<IImageProvider> imageProviders);
  54. /// <summary>
  55. /// Gets the available remote images.
  56. /// </summary>
  57. /// <param name="item">The item.</param>
  58. /// <param name="cancellationToken">The cancellation token.</param>
  59. /// <param name="providerName">Name of the provider.</param>
  60. /// <param name="type">The type.</param>
  61. /// <returns>Task{IEnumerable{RemoteImageInfo}}.</returns>
  62. Task<IEnumerable<RemoteImageInfo>> GetAvailableRemoteImages(BaseItem item, CancellationToken cancellationToken, string providerName = null, ImageType? type = null);
  63. /// <summary>
  64. /// Gets the image providers.
  65. /// </summary>
  66. /// <param name="item">The item.</param>
  67. /// <returns>IEnumerable{IImageProvider}.</returns>
  68. IEnumerable<IImageProvider> GetImageProviders(BaseItem item);
  69. }
  70. }