IChannel.cs 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. /// Determines whether [is enabled for] [the specified user].
  26. /// </summary>
  27. /// <param name="user">The user.</param>
  28. /// <returns><c>true</c> if [is enabled for] [the specified user]; otherwise, <c>false</c>.</returns>
  29. bool IsEnabledFor(User user);
  30. /// <summary>
  31. /// Searches the specified search term.
  32. /// </summary>
  33. /// <param name="searchInfo">The search information.</param>
  34. /// <param name="user">The user.</param>
  35. /// <param name="cancellationToken">The cancellation token.</param>
  36. /// <returns>Task{IEnumerable{ChannelItemInfo}}.</returns>
  37. Task<IEnumerable<ChannelItemInfo>> Search(ChannelSearchInfo searchInfo, User user, CancellationToken cancellationToken);
  38. /// <summary>
  39. /// Gets the channel items.
  40. /// </summary>
  41. /// <param name="user">The user.</param>
  42. /// <param name="cancellationToken">The cancellation token.</param>
  43. /// <returns>Task{IEnumerable{ChannelItem}}.</returns>
  44. Task<IEnumerable<ChannelItemInfo>> GetChannelItems(User user, CancellationToken cancellationToken);
  45. /// <summary>
  46. /// Gets the channel items.
  47. /// </summary>
  48. /// <param name="categoryId">The category identifier.</param>
  49. /// <param name="user">The user.</param>
  50. /// <param name="cancellationToken">The cancellation token.</param>
  51. /// <returns>Task{IEnumerable{ChannelItem}}.</returns>
  52. Task<IEnumerable<ChannelItemInfo>> GetChannelItems(string categoryId, User user, CancellationToken cancellationToken);
  53. }
  54. public class ChannelCapabilities
  55. {
  56. public bool CanSearch { get; set; }
  57. }
  58. public class ChannelSearchInfo
  59. {
  60. public string SearchTerm { get; set; }
  61. }
  62. }