LibraryOptions.cs 3.4 KB

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