LibraryOptions.cs 3.9 KB

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