IProviderManager.cs 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. /// Refreshes the metadata.
  18. /// </summary>
  19. /// <param name="item">The item.</param>
  20. /// <param name="options">The options.</param>
  21. /// <param name="cancellationToken">The cancellation token.</param>
  22. /// <returns>Task.</returns>
  23. Task RefreshMetadata(IHasMetadata item, MetadataRefreshOptions options, CancellationToken cancellationToken);
  24. /// <summary>
  25. /// Executes the metadata providers.
  26. /// </summary>
  27. /// <param name="item">The item.</param>
  28. /// <param name="cancellationToken">The cancellation token.</param>
  29. /// <param name="force">if set to <c>true</c> [force].</param>
  30. /// <returns>Task{System.Boolean}.</returns>
  31. Task<ItemUpdateType?> ExecuteMetadataProviders(BaseItem item, CancellationToken cancellationToken, bool force = false);
  32. /// <summary>
  33. /// Saves the image.
  34. /// </summary>
  35. /// <param name="item">The item.</param>
  36. /// <param name="url">The URL.</param>
  37. /// <param name="resourcePool">The resource pool.</param>
  38. /// <param name="type">The type.</param>
  39. /// <param name="imageIndex">Index of the image.</param>
  40. /// <param name="cancellationToken">The cancellation token.</param>
  41. /// <returns>Task.</returns>
  42. Task SaveImage(BaseItem item, string url, SemaphoreSlim resourcePool, ImageType type, int? imageIndex, CancellationToken cancellationToken);
  43. /// <summary>
  44. /// Saves the image.
  45. /// </summary>
  46. /// <param name="item">The item.</param>
  47. /// <param name="source">The source.</param>
  48. /// <param name="mimeType">Type of the MIME.</param>
  49. /// <param name="type">The type.</param>
  50. /// <param name="imageIndex">Index of the image.</param>
  51. /// <param name="sourceUrl">The source URL.</param>
  52. /// <param name="cancellationToken">The cancellation token.</param>
  53. /// <returns>Task.</returns>
  54. Task SaveImage(BaseItem item, Stream source, string mimeType, ImageType type, int? imageIndex, string sourceUrl, CancellationToken cancellationToken);
  55. /// <summary>
  56. /// Adds the metadata providers.
  57. /// </summary>
  58. /// <param name="providers">The providers.</param>
  59. /// <param name="imageProviders">The image providers.</param>
  60. /// <param name="metadataServices">The metadata services.</param>
  61. /// <param name="metadataProviders">The metadata providers.</param>
  62. void AddParts(IEnumerable<BaseMetadataProvider> providers, IEnumerable<IImageProvider> imageProviders, IEnumerable<IMetadataService> metadataServices, IEnumerable<IMetadataProvider> metadataProviders);
  63. /// <summary>
  64. /// Gets the available remote images.
  65. /// </summary>
  66. /// <param name="item">The item.</param>
  67. /// <param name="cancellationToken">The cancellation token.</param>
  68. /// <param name="providerName">Name of the provider.</param>
  69. /// <param name="type">The type.</param>
  70. /// <returns>Task{IEnumerable{RemoteImageInfo}}.</returns>
  71. Task<IEnumerable<RemoteImageInfo>> GetAvailableRemoteImages(BaseItem item, CancellationToken cancellationToken, string providerName = null, ImageType? type = null);
  72. /// <summary>
  73. /// Gets the image providers.
  74. /// </summary>
  75. /// <param name="item">The item.</param>
  76. /// <returns>IEnumerable{ImageProviderInfo}.</returns>
  77. IEnumerable<ImageProviderInfo> GetImageProviderInfo(BaseItem item);
  78. }
  79. }