LiveTvOptions.cs 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. using System.Collections.Generic;
  2. using MediaBrowser.Model.Dto;
  3. using MediaBrowser.Model.Extensions;
  4. namespace MediaBrowser.Model.LiveTv
  5. {
  6. public class LiveTvOptions
  7. {
  8. public int? GuideDays { get; set; }
  9. public bool EnableMovieProviders { get; set; }
  10. public string RecordingPath { get; set; }
  11. public string MovieRecordingPath { get; set; }
  12. public string SeriesRecordingPath { get; set; }
  13. public bool EnableAutoOrganize { get; set; }
  14. public bool EnableRecordingEncoding { get; set; }
  15. public bool EnableRecordingSubfolders { get; set; }
  16. public bool EnableOriginalAudioWithEncodedRecordings { get; set; }
  17. public List<TunerHostInfo> TunerHosts { get; set; }
  18. public List<ListingsProviderInfo> ListingProviders { get; set; }
  19. public int PrePaddingSeconds { get; set; }
  20. public int PostPaddingSeconds { get; set; }
  21. public string[] MediaLocationsCreated { get; set; }
  22. public LiveTvOptions()
  23. {
  24. EnableMovieProviders = true;
  25. EnableRecordingSubfolders = true;
  26. TunerHosts = new List<TunerHostInfo>();
  27. ListingProviders = new List<ListingsProviderInfo>();
  28. MediaLocationsCreated = new string[] { };
  29. }
  30. }
  31. public class TunerHostInfo
  32. {
  33. public string Id { get; set; }
  34. public string Url { get; set; }
  35. public string Type { get; set; }
  36. public string DeviceId { get; set; }
  37. public bool ImportFavoritesOnly { get; set; }
  38. public bool AllowHWTranscoding { get; set; }
  39. public bool IsEnabled { get; set; }
  40. public string M3UUrl { get; set; }
  41. public string InfoUrl { get; set; }
  42. public string FriendlyName { get; set; }
  43. public int Tuners { get; set; }
  44. public string DiseqC { get; set; }
  45. public string SourceA { get; set; }
  46. public string SourceB { get; set; }
  47. public string SourceC { get; set; }
  48. public string SourceD { get; set; }
  49. public int DataVersion { get; set; }
  50. public TunerHostInfo()
  51. {
  52. IsEnabled = true;
  53. AllowHWTranscoding = true;
  54. }
  55. }
  56. public class ListingsProviderInfo
  57. {
  58. public string Id { get; set; }
  59. public string Type { get; set; }
  60. public string Username { get; set; }
  61. public string Password { get; set; }
  62. public string ListingsId { get; set; }
  63. public string ZipCode { get; set; }
  64. public string Country { get; set; }
  65. public string Path { get; set; }
  66. public string[] EnabledTuners { get; set; }
  67. public bool EnableAllTuners { get; set; }
  68. public string[] NewsCategories { get; set; }
  69. public string[] SportsCategories { get; set; }
  70. public string[] KidsCategories { get; set; }
  71. public string[] MovieCategories { get; set; }
  72. public NameValuePair[] ChannelMappings { get; set; }
  73. public ListingsProviderInfo()
  74. {
  75. NewsCategories = new string[] { "news", "journalism", "documentary", "current affairs" };
  76. SportsCategories = new string[] { "sports", "basketball", "baseball", "football" };
  77. KidsCategories = new string[] { "kids", "family", "children", "childrens", "disney" };
  78. MovieCategories = new string[] { "movie" };
  79. EnabledTuners = new string[] { };
  80. EnableAllTuners = true;
  81. ChannelMappings = new NameValuePair[] {};
  82. }
  83. public string GetMappedChannel(string channelNumber)
  84. {
  85. foreach (NameValuePair mapping in ChannelMappings)
  86. {
  87. if (StringHelper.EqualsIgnoreCase(mapping.Name, channelNumber))
  88. {
  89. return mapping.Value;
  90. }
  91. }
  92. return channelNumber;
  93. }
  94. }
  95. }