IProviderManager.cs 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. using MediaBrowser.Controller.Entities;
  2. using MediaBrowser.Controller.Library;
  3. using MediaBrowser.Model.Configuration;
  4. using MediaBrowser.Model.Entities;
  5. using MediaBrowser.Model.Providers;
  6. using System.Collections.Generic;
  7. using System.IO;
  8. using System.Threading;
  9. using System.Threading.Tasks;
  10. namespace MediaBrowser.Controller.Providers
  11. {
  12. /// <summary>
  13. /// Interface IProviderManager
  14. /// </summary>
  15. public interface IProviderManager
  16. {
  17. /// <summary>
  18. /// Refreshes the metadata.
  19. /// </summary>
  20. /// <param name="item">The item.</param>
  21. /// <param name="options">The options.</param>
  22. /// <param name="cancellationToken">The cancellation token.</param>
  23. /// <returns>Task.</returns>
  24. Task RefreshMetadata(IHasMetadata item, MetadataRefreshOptions options, CancellationToken cancellationToken);
  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(IHasImages 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="cancellationToken">The cancellation token.</param>
  45. /// <returns>Task.</returns>
  46. Task SaveImage(IHasImages item, Stream source, string mimeType, ImageType type, int? imageIndex, CancellationToken cancellationToken);
  47. /// <summary>
  48. /// Adds the metadata providers.
  49. /// </summary>
  50. /// <param name="imageProviders">The image providers.</param>
  51. /// <param name="metadataServices">The metadata services.</param>
  52. /// <param name="metadataProviders">The metadata providers.</param>
  53. /// <param name="savers">The savers.</param>
  54. /// <param name="imageSavers">The image savers.</param>
  55. /// <param name="externalIds">The external ids.</param>
  56. void AddParts(IEnumerable<IImageProvider> imageProviders, IEnumerable<IMetadataService> metadataServices, IEnumerable<IMetadataProvider> metadataProviders,
  57. IEnumerable<IMetadataSaver> savers,
  58. IEnumerable<IImageSaver> imageSavers,
  59. IEnumerable<IExternalId> externalIds);
  60. /// <summary>
  61. /// Gets the available remote images.
  62. /// </summary>
  63. /// <param name="item">The item.</param>
  64. /// <param name="query">The query.</param>
  65. /// <param name="cancellationToken">The cancellation token.</param>
  66. /// <returns>Task{IEnumerable{RemoteImageInfo}}.</returns>
  67. Task<IEnumerable<RemoteImageInfo>> GetAvailableRemoteImages(IHasImages item, RemoteImageQuery query, CancellationToken cancellationToken);
  68. /// <summary>
  69. /// Gets the image providers.
  70. /// </summary>
  71. /// <param name="item">The item.</param>
  72. /// <returns>IEnumerable{ImageProviderInfo}.</returns>
  73. IEnumerable<ImageProviderInfo> GetRemoteImageProviderInfo(IHasImages item);
  74. /// <summary>
  75. /// Gets all metadata plugins.
  76. /// </summary>
  77. /// <returns>IEnumerable{MetadataPlugin}.</returns>
  78. IEnumerable<MetadataPluginSummary> GetAllMetadataPlugins();
  79. /// <summary>
  80. /// Gets the external urls.
  81. /// </summary>
  82. /// <param name="item">The item.</param>
  83. /// <returns>IEnumerable{ExternalUrl}.</returns>
  84. IEnumerable<ExternalUrl> GetExternalUrls(IHasProviderIds item);
  85. /// <summary>
  86. /// Gets the external identifier infos.
  87. /// </summary>
  88. /// <param name="item">The item.</param>
  89. /// <returns>IEnumerable{ExternalIdInfo}.</returns>
  90. IEnumerable<ExternalIdInfo> GetExternalIdInfos(IHasProviderIds item);
  91. /// <summary>
  92. /// Saves the metadata.
  93. /// </summary>
  94. /// <param name="item">The item.</param>
  95. /// <param name="updateType">Type of the update.</param>
  96. /// <returns>Task.</returns>
  97. Task SaveMetadata(IHasMetadata item, ItemUpdateType updateType);
  98. /// <summary>
  99. /// Gets the metadata options.
  100. /// </summary>
  101. /// <param name="item">The item.</param>
  102. /// <returns>MetadataOptions.</returns>
  103. MetadataOptions GetMetadataOptions(IHasImages item);
  104. /// <summary>
  105. /// Gets the remote search results.
  106. /// </summary>
  107. /// <typeparam name="TItemType">The type of the t item type.</typeparam>
  108. /// <typeparam name="TLookupType">The type of the t lookup type.</typeparam>
  109. /// <param name="searchInfo">The search information.</param>
  110. /// <param name="cancellationToken">The cancellation token.</param>
  111. /// <returns>Task{IEnumerable{SearchResult{``1}}}.</returns>
  112. Task<IEnumerable<RemoteSearchResult>> GetRemoteSearchResults<TItemType, TLookupType>(
  113. RemoteSearchQuery<TLookupType> searchInfo,
  114. CancellationToken cancellationToken)
  115. where TItemType : BaseItem, new()
  116. where TLookupType : ItemLookupInfo;
  117. }
  118. }