IChannel.cs 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. using MediaBrowser.Controller.Entities;
  2. using MediaBrowser.Controller.Providers;
  3. using MediaBrowser.Model.Entities;
  4. using System.Collections.Generic;
  5. using System.Threading;
  6. using System.Threading.Tasks;
  7. namespace MediaBrowser.Controller.Channels
  8. {
  9. public interface IChannel
  10. {
  11. /// <summary>
  12. /// Gets the name.
  13. /// </summary>
  14. /// <value>The name.</value>
  15. string Name { get; }
  16. /// <summary>
  17. /// Gets the data version.
  18. /// </summary>
  19. /// <value>The data version.</value>
  20. string DataVersion { get; }
  21. /// <summary>
  22. /// Gets the home page URL.
  23. /// </summary>
  24. /// <value>The home page URL.</value>
  25. string HomePageUrl { get; }
  26. /// <summary>
  27. /// Gets the channel information.
  28. /// </summary>
  29. /// <returns>ChannelFeatures.</returns>
  30. InternalChannelFeatures GetChannelFeatures();
  31. /// <summary>
  32. /// Determines whether [is enabled for] [the specified user].
  33. /// </summary>
  34. /// <param name="user">The user.</param>
  35. /// <returns><c>true</c> if [is enabled for] [the specified user]; otherwise, <c>false</c>.</returns>
  36. bool IsEnabledFor(User user);
  37. /// <summary>
  38. /// Searches the specified search term.
  39. /// </summary>
  40. /// <param name="searchInfo">The search information.</param>
  41. /// <param name="user">The user.</param>
  42. /// <param name="cancellationToken">The cancellation token.</param>
  43. /// <returns>Task{IEnumerable{ChannelItemInfo}}.</returns>
  44. Task<IEnumerable<ChannelItemInfo>> Search(ChannelSearchInfo searchInfo, User user, CancellationToken cancellationToken);
  45. /// <summary>
  46. /// Gets the channel items.
  47. /// </summary>
  48. /// <param name="query">The query.</param>
  49. /// <param name="cancellationToken">The cancellation token.</param>
  50. /// <returns>Task{IEnumerable{ChannelItem}}.</returns>
  51. Task<ChannelItemResult> GetChannelItems(InternalChannelItemQuery query, CancellationToken cancellationToken);
  52. /// <summary>
  53. /// Gets the channel image.
  54. /// </summary>
  55. /// <param name="type">The type.</param>
  56. /// <param name="cancellationToken">The cancellation token.</param>
  57. /// <returns>Task{DynamicImageInfo}.</returns>
  58. Task<DynamicImageResponse> GetChannelImage(ImageType type, CancellationToken cancellationToken);
  59. /// <summary>
  60. /// Gets the supported channel images.
  61. /// </summary>
  62. /// <returns>IEnumerable{ImageType}.</returns>
  63. IEnumerable<ImageType> GetSupportedChannelImages();
  64. }
  65. public interface IRequiresMediaInfoCallback
  66. {
  67. /// <summary>
  68. /// Gets the channel item media information.
  69. /// </summary>
  70. /// <param name="id">The identifier.</param>
  71. /// <param name="cancellationToken">The cancellation token.</param>
  72. /// <returns>Task{IEnumerable{ChannelMediaInfo}}.</returns>
  73. Task<IEnumerable<ChannelMediaInfo>> GetChannelItemMediaInfo(string id, CancellationToken cancellationToken);
  74. }
  75. }