LibraryOptions.cs 3.7 KB

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