LibraryOptions.cs 3.5 KB

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