LiveTvOptions.cs 3.9 KB

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