LibraryOptions.cs 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. #pragma warning disable CS1591
  2. using System;
  3. using System.ComponentModel;
  4. namespace MediaBrowser.Model.Configuration
  5. {
  6. public class LibraryOptions
  7. {
  8. public LibraryOptions()
  9. {
  10. TypeOptions = Array.Empty<TypeOptions>();
  11. DisabledSubtitleFetchers = Array.Empty<string>();
  12. DisabledMediaSegmentProviders = Array.Empty<string>();
  13. MediaSegmentProvideOrder = Array.Empty<string>();
  14. SubtitleFetcherOrder = Array.Empty<string>();
  15. DisabledLocalMetadataReaders = Array.Empty<string>();
  16. DisabledLyricFetchers = Array.Empty<string>();
  17. LyricFetcherOrder = Array.Empty<string>();
  18. SkipSubtitlesIfAudioTrackMatches = true;
  19. RequirePerfectSubtitleMatch = true;
  20. AllowEmbeddedSubtitles = EmbeddedSubtitleOptions.AllowAll;
  21. AutomaticallyAddToCollection = false;
  22. EnablePhotos = true;
  23. SaveSubtitlesWithMedia = true;
  24. SaveLyricsWithMedia = false;
  25. SaveTrickplayWithMedia = false;
  26. PathInfos = Array.Empty<MediaPathInfo>();
  27. EnableAutomaticSeriesGrouping = true;
  28. SeasonZeroDisplayName = "Specials";
  29. }
  30. public bool Enabled { get; set; } = true;
  31. public bool EnablePhotos { get; set; }
  32. public bool EnableRealtimeMonitor { get; set; }
  33. public bool EnableLUFSScan { get; set; }
  34. public bool EnableChapterImageExtraction { get; set; }
  35. public bool ExtractChapterImagesDuringLibraryScan { get; set; }
  36. public bool EnableTrickplayImageExtraction { get; set; }
  37. public bool ExtractTrickplayImagesDuringLibraryScan { get; set; }
  38. public MediaPathInfo[] PathInfos { get; set; }
  39. public bool SaveLocalMetadata { get; set; }
  40. [Obsolete("Disable remote providers in TypeOptions instead")]
  41. public bool EnableInternetProviders { get; set; }
  42. public bool EnableAutomaticSeriesGrouping { get; set; }
  43. public bool EnableEmbeddedTitles { get; set; }
  44. public bool EnableEmbeddedExtrasTitles { get; set; }
  45. public bool EnableEmbeddedEpisodeInfos { get; set; }
  46. public int AutomaticRefreshIntervalDays { get; set; }
  47. /// <summary>
  48. /// Gets or sets the preferred metadata language.
  49. /// </summary>
  50. /// <value>The preferred metadata language.</value>
  51. public string? PreferredMetadataLanguage { get; set; }
  52. /// <summary>
  53. /// Gets or sets the metadata country code.
  54. /// </summary>
  55. /// <value>The metadata country code.</value>
  56. public string? MetadataCountryCode { get; set; }
  57. public string SeasonZeroDisplayName { get; set; }
  58. public string[]? MetadataSavers { get; set; }
  59. public string[] DisabledLocalMetadataReaders { get; set; }
  60. public string[]? LocalMetadataReaderOrder { get; set; }
  61. public string[] DisabledSubtitleFetchers { get; set; }
  62. public string[] SubtitleFetcherOrder { get; set; }
  63. public string[] DisabledMediaSegmentProviders { get; set; }
  64. public string[] MediaSegmentProvideOrder { get; set; }
  65. public bool SkipSubtitlesIfEmbeddedSubtitlesPresent { get; set; }
  66. public bool SkipSubtitlesIfAudioTrackMatches { get; set; }
  67. public string[]? SubtitleDownloadLanguages { get; set; }
  68. public bool RequirePerfectSubtitleMatch { get; set; }
  69. public bool SaveSubtitlesWithMedia { get; set; }
  70. [DefaultValue(false)]
  71. public bool SaveLyricsWithMedia { get; set; }
  72. [DefaultValue(false)]
  73. public bool SaveTrickplayWithMedia { get; set; }
  74. public string[] DisabledLyricFetchers { get; set; }
  75. public string[] LyricFetcherOrder { get; set; }
  76. public bool AutomaticallyAddToCollection { get; set; }
  77. public EmbeddedSubtitleOptions AllowEmbeddedSubtitles { get; set; }
  78. public TypeOptions[] TypeOptions { get; set; }
  79. public TypeOptions? GetTypeOptions(string type)
  80. {
  81. foreach (var options in TypeOptions)
  82. {
  83. if (string.Equals(options.Type, type, StringComparison.OrdinalIgnoreCase))
  84. {
  85. return options;
  86. }
  87. }
  88. return null;
  89. }
  90. }
  91. }