LiveTvOptions.cs 4.1 KB

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