IChannel.cs 2.1 KB

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