2
0

LibraryOptions.cs 3.2 KB

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