IRemoteMetadataProvider.cs 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using MediaBrowser.Common.Net;
  2. using MediaBrowser.Controller.Entities;
  3. using MediaBrowser.Model.Providers;
  4. using System.Collections.Generic;
  5. using System.Threading;
  6. using System.Threading.Tasks;
  7. namespace MediaBrowser.Controller.Providers
  8. {
  9. public interface IRemoteMetadataProvider : IMetadataProvider
  10. {
  11. }
  12. public interface IRemoteMetadataProvider<TItemType, in TLookupInfoType> : IMetadataProvider<TItemType>, IRemoteMetadataProvider, IRemoteSearchProvider<TLookupInfoType>
  13. where TItemType : IHasMetadata, IHasLookupInfo<TLookupInfoType>
  14. where TLookupInfoType : ItemLookupInfo, new()
  15. {
  16. Task<MetadataResult<TItemType>> GetMetadata(TLookupInfoType info, CancellationToken cancellationToken);
  17. }
  18. public interface IRemoteSearchProvider : IMetadataProvider
  19. {
  20. /// <summary>
  21. /// Gets the image response.
  22. /// </summary>
  23. /// <param name="url">The URL.</param>
  24. /// <param name="cancellationToken">The cancellation token.</param>
  25. /// <returns>Task{HttpResponseInfo}.</returns>
  26. Task<HttpResponseInfo> GetImageResponse(string url, CancellationToken cancellationToken);
  27. }
  28. public interface IRemoteSearchProvider<in TLookupInfoType> : IRemoteSearchProvider
  29. where TLookupInfoType : ItemLookupInfo
  30. {
  31. Task<IEnumerable<RemoteSearchResult>> GetSearchResults(TLookupInfoType searchInfo, CancellationToken cancellationToken);
  32. }
  33. public class RemoteSearchQuery<T>
  34. where T : ItemLookupInfo
  35. {
  36. public T SearchInfo { get; set; }
  37. /// <summary>
  38. /// If set will only search within the given provider
  39. /// </summary>
  40. public string SearchProviderName { get; set; }
  41. /// <summary>
  42. /// Gets or sets a value indicating whether [include disabled providers].
  43. /// </summary>
  44. /// <value><c>true</c> if [include disabled providers]; otherwise, <c>false</c>.</value>
  45. public bool IncludeDisabledProviders { get; set; }
  46. }
  47. }