IChannel.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. using System.Collections.Generic;
  2. using System.Threading;
  3. using System.Threading.Tasks;
  4. namespace MediaBrowser.Controller.Channels
  5. {
  6. public interface IChannel
  7. {
  8. /// <summary>
  9. /// Gets the name.
  10. /// </summary>
  11. /// <value>The name.</value>
  12. string Name { get; }
  13. /// <summary>
  14. /// Gets the home page URL.
  15. /// </summary>
  16. /// <value>The home page URL.</value>
  17. string HomePageUrl { get; }
  18. /// <summary>
  19. /// Gets the capabilities.
  20. /// </summary>
  21. /// <returns>ChannelCapabilities.</returns>
  22. ChannelCapabilities GetCapabilities();
  23. /// <summary>
  24. /// Searches the specified search term.
  25. /// </summary>
  26. /// <param name="searchTerm">The search term.</param>
  27. /// <param name="cancellationToken">The cancellation token.</param>
  28. /// <returns>Task{IEnumerable{ChannelItemInfo}}.</returns>
  29. Task<IEnumerable<ChannelItemInfo>> Search(string searchTerm, CancellationToken cancellationToken);
  30. /// <summary>
  31. /// Gets the channel items.
  32. /// </summary>
  33. /// <param name="cancellationToken">The cancellation token.</param>
  34. /// <returns>Task{IEnumerable{ChannelItem}}.</returns>
  35. Task<IEnumerable<ChannelItemInfo>> GetChannelItems(CancellationToken cancellationToken);
  36. /// <summary>
  37. /// Gets the channel items.
  38. /// </summary>
  39. /// <param name="categoryId">The category identifier.</param>
  40. /// <param name="cancellationToken">The cancellation token.</param>
  41. /// <returns>Task{IEnumerable{ChannelItem}}.</returns>
  42. Task<IEnumerable<ChannelItemInfo>> GetChannelItems(string categoryId, CancellationToken cancellationToken);
  43. }
  44. public class ChannelCapabilities
  45. {
  46. public bool CanSearch { get; set; }
  47. public bool CanBeIndexed { get; set; }
  48. }
  49. }