LiveTvService.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. using MediaBrowser.Common.Configuration;
  2. using MediaBrowser.Common.Net;
  3. using MediaBrowser.Controller.LiveTv;
  4. using System.Collections.Generic;
  5. using System.Threading;
  6. using System.Threading.Tasks;
  7. using MediaBrowser.Model.Logging;
  8. using MediaBrowser.Model.Serialization;
  9. namespace MediaBrowser.Plugins.NextPvr
  10. {
  11. /// <summary>
  12. /// Class LiveTvService
  13. /// </summary>
  14. public class LiveTvService : ILiveTvService
  15. {
  16. private readonly ILogger _logger;
  17. private IApplicationPaths _appPaths;
  18. private IJsonSerializer _json;
  19. private IHttpClient _httpClient;
  20. public LiveTvService(ILogger logger)
  21. {
  22. _logger = logger;
  23. }
  24. /// <summary>
  25. /// Gets the channels async.
  26. /// </summary>
  27. /// <param name="cancellationToken">The cancellation token.</param>
  28. /// <returns>Task{IEnumerable{ChannelInfo}}.</returns>
  29. public Task<IEnumerable<ChannelInfo>> GetChannelsAsync(CancellationToken cancellationToken)
  30. {
  31. //using (var stream = await _httpClient.Get(new HttpRequestOptions()
  32. // {
  33. // Url = "",
  34. // CancellationToken = cancellationToken
  35. // }))
  36. //{
  37. //}
  38. _logger.Info("GetChannelsAsync");
  39. var channels = new List<ChannelInfo>
  40. {
  41. new ChannelInfo
  42. {
  43. Name = "NBC",
  44. ServiceName = Name
  45. }
  46. };
  47. return Task.FromResult<IEnumerable<ChannelInfo>>(channels);
  48. }
  49. /// <summary>
  50. /// Gets the name.
  51. /// </summary>
  52. /// <value>The name.</value>
  53. public string Name
  54. {
  55. get { return "Next Pvr"; }
  56. }
  57. }
  58. }