ILiveTvService.cs 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. using MediaBrowser.Common.Net;
  2. using MediaBrowser.Model.LiveTv;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Threading;
  6. using System.Threading.Tasks;
  7. namespace MediaBrowser.Controller.LiveTv
  8. {
  9. /// <summary>
  10. /// Represents a single live tv back end (next pvr, media portal, etc).
  11. /// </summary>
  12. public interface ILiveTvService
  13. {
  14. /// <summary>
  15. /// Gets the name.
  16. /// </summary>
  17. /// <value>The name.</value>
  18. string Name { get; }
  19. /// <summary>
  20. /// Gets the channels async.
  21. /// </summary>
  22. /// <param name="cancellationToken">The cancellation token.</param>
  23. /// <returns>Task{IEnumerable{ChannelInfo}}.</returns>
  24. Task<IEnumerable<ChannelInfo>> GetChannelsAsync(CancellationToken cancellationToken);
  25. /// <summary>
  26. /// Cancels the recording asynchronous.
  27. /// </summary>
  28. /// <param name="recordingId">The recording identifier.</param>
  29. /// <param name="cancellationToken">The cancellation token.</param>
  30. /// <returns>Task.</returns>
  31. Task CancelRecordingAsync(string recordingId, CancellationToken cancellationToken);
  32. /// <summary>
  33. /// Schedules the recording asynchronous.
  34. /// </summary>
  35. /// <param name="name">The name for the recording</param>
  36. /// <param name="channelId">The channel identifier.</param>
  37. /// <param name="startTime">The start time.</param>
  38. /// <param name="duration">The duration.</param>
  39. /// <param name="cancellationToken">The cancellation token.</param>
  40. /// <returns>Task.</returns>
  41. Task ScheduleRecordingAsync(string name,string channelId, DateTime startTime, TimeSpan duration, CancellationToken cancellationToken);
  42. /// <summary>
  43. /// Gets the channel image asynchronous.
  44. /// </summary>
  45. /// <param name="channelId">The channel identifier.</param>
  46. /// <param name="cancellationToken">The cancellation token.</param>
  47. /// <returns>Task{Stream}.</returns>
  48. Task<HttpResponseInfo> GetChannelImageAsync(string channelId, CancellationToken cancellationToken);
  49. /// <summary>
  50. /// Gets the recordings asynchronous.
  51. /// </summary>
  52. /// <param name="query">The query.</param>
  53. /// <param name="cancellationToken">The cancellation token.</param>
  54. /// <returns>Task{IEnumerable{RecordingInfo}}.</returns>
  55. Task<IEnumerable<RecordingInfo>> GetRecordingsAsync(RecordingQuery query, CancellationToken cancellationToken);
  56. /// <summary>
  57. /// Gets the channel guides.
  58. /// </summary>
  59. /// <param name="channelIdList">The channel identifier list.</param>
  60. /// <param name="cancellationToken">The cancellation token.</param>
  61. /// <returns>Task{IEnumerable{ChannelGuide}}.</returns>
  62. Task<IEnumerable<ChannelGuide>> GetChannelGuidesAsync(IEnumerable<string> channelIdList, CancellationToken cancellationToken);
  63. }
  64. }