LibraryOptions.cs 3.7 KB

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