LibraryOptions.cs 3.0 KB

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