| | 1 | | #pragma warning disable CS1591 |
| | 2 | |
|
| | 3 | | using System; |
| | 4 | | using System.ComponentModel; |
| | 5 | | using System.Linq; |
| | 6 | |
|
| | 7 | | namespace MediaBrowser.Model.Configuration |
| | 8 | | { |
| | 9 | | public class LibraryOptions |
| | 10 | | { |
| 2 | 11 | | private static readonly string[] _defaultTagDelimiters = ["/", "|", ";", "\\"]; |
| | 12 | |
|
| | 13 | | public LibraryOptions() |
| | 14 | | { |
| 495 | 15 | | TypeOptions = Array.Empty<TypeOptions>(); |
| 495 | 16 | | DisabledSubtitleFetchers = Array.Empty<string>(); |
| 495 | 17 | | DisabledMediaSegmentProviders = Array.Empty<string>(); |
| 495 | 18 | | MediaSegmentProviderOrder = Array.Empty<string>(); |
| 495 | 19 | | SubtitleFetcherOrder = Array.Empty<string>(); |
| 495 | 20 | | DisabledLocalMetadataReaders = Array.Empty<string>(); |
| 495 | 21 | | DisabledLyricFetchers = Array.Empty<string>(); |
| 495 | 22 | | LyricFetcherOrder = Array.Empty<string>(); |
| | 23 | |
|
| 495 | 24 | | SkipSubtitlesIfAudioTrackMatches = true; |
| 495 | 25 | | RequirePerfectSubtitleMatch = true; |
| 495 | 26 | | AllowEmbeddedSubtitles = EmbeddedSubtitleOptions.AllowAll; |
| | 27 | |
|
| 495 | 28 | | AutomaticallyAddToCollection = false; |
| 495 | 29 | | EnablePhotos = true; |
| 495 | 30 | | SaveSubtitlesWithMedia = true; |
| 495 | 31 | | SaveLyricsWithMedia = false; |
| 495 | 32 | | SaveTrickplayWithMedia = false; |
| 495 | 33 | | PathInfos = Array.Empty<MediaPathInfo>(); |
| 495 | 34 | | EnableAutomaticSeriesGrouping = true; |
| 495 | 35 | | SeasonZeroDisplayName = "Specials"; |
| | 36 | |
|
| 495 | 37 | | PreferNonstandardArtistsTag = false; |
| 495 | 38 | | UseCustomTagDelimiters = false; |
| 495 | 39 | | CustomTagDelimiters = _defaultTagDelimiters; |
| 495 | 40 | | DelimiterWhitelist = Array.Empty<string>(); |
| 495 | 41 | | } |
| | 42 | |
|
| | 43 | | public bool Enabled { get; set; } = true; |
| | 44 | |
|
| | 45 | | public bool EnablePhotos { get; set; } |
| | 46 | |
|
| | 47 | | public bool EnableRealtimeMonitor { get; set; } |
| | 48 | |
|
| | 49 | | public bool EnableLUFSScan { get; set; } |
| | 50 | |
|
| | 51 | | public bool EnableChapterImageExtraction { get; set; } |
| | 52 | |
|
| | 53 | | public bool ExtractChapterImagesDuringLibraryScan { get; set; } |
| | 54 | |
|
| | 55 | | public bool EnableTrickplayImageExtraction { get; set; } |
| | 56 | |
|
| | 57 | | public bool ExtractTrickplayImagesDuringLibraryScan { get; set; } |
| | 58 | |
|
| | 59 | | public MediaPathInfo[] PathInfos { get; set; } |
| | 60 | |
|
| | 61 | | public bool SaveLocalMetadata { get; set; } |
| | 62 | |
|
| | 63 | | [Obsolete("Disable remote providers in TypeOptions instead")] |
| | 64 | | public bool EnableInternetProviders { get; set; } |
| | 65 | |
|
| | 66 | | public bool EnableAutomaticSeriesGrouping { get; set; } |
| | 67 | |
|
| | 68 | | public bool EnableEmbeddedTitles { get; set; } |
| | 69 | |
|
| | 70 | | public bool EnableEmbeddedExtrasTitles { get; set; } |
| | 71 | |
|
| | 72 | | public bool EnableEmbeddedEpisodeInfos { get; set; } |
| | 73 | |
|
| | 74 | | public int AutomaticRefreshIntervalDays { get; set; } |
| | 75 | |
|
| | 76 | | /// <summary> |
| | 77 | | /// Gets or sets the preferred metadata language. |
| | 78 | | /// </summary> |
| | 79 | | /// <value>The preferred metadata language.</value> |
| | 80 | | public string? PreferredMetadataLanguage { get; set; } |
| | 81 | |
|
| | 82 | | /// <summary> |
| | 83 | | /// Gets or sets the metadata country code. |
| | 84 | | /// </summary> |
| | 85 | | /// <value>The metadata country code.</value> |
| | 86 | | public string? MetadataCountryCode { get; set; } |
| | 87 | |
|
| | 88 | | public string SeasonZeroDisplayName { get; set; } |
| | 89 | |
|
| | 90 | | public string[]? MetadataSavers { get; set; } |
| | 91 | |
|
| | 92 | | public string[] DisabledLocalMetadataReaders { get; set; } |
| | 93 | |
|
| | 94 | | public string[]? LocalMetadataReaderOrder { get; set; } |
| | 95 | |
|
| | 96 | | public string[] DisabledSubtitleFetchers { get; set; } |
| | 97 | |
|
| | 98 | | public string[] SubtitleFetcherOrder { get; set; } |
| | 99 | |
|
| | 100 | | public string[] DisabledMediaSegmentProviders { get; set; } |
| | 101 | |
|
| | 102 | | public string[] MediaSegmentProviderOrder { get; set; } |
| | 103 | |
|
| | 104 | | public bool SkipSubtitlesIfEmbeddedSubtitlesPresent { get; set; } |
| | 105 | |
|
| | 106 | | public bool SkipSubtitlesIfAudioTrackMatches { get; set; } |
| | 107 | |
|
| | 108 | | public string[]? SubtitleDownloadLanguages { get; set; } |
| | 109 | |
|
| | 110 | | public bool RequirePerfectSubtitleMatch { get; set; } |
| | 111 | |
|
| | 112 | | public bool SaveSubtitlesWithMedia { get; set; } |
| | 113 | |
|
| | 114 | | [DefaultValue(false)] |
| | 115 | | public bool SaveLyricsWithMedia { get; set; } |
| | 116 | |
|
| | 117 | | [DefaultValue(false)] |
| | 118 | | public bool SaveTrickplayWithMedia { get; set; } |
| | 119 | |
|
| | 120 | | public string[] DisabledLyricFetchers { get; set; } |
| | 121 | |
|
| | 122 | | public string[] LyricFetcherOrder { get; set; } |
| | 123 | |
|
| | 124 | | [DefaultValue(false)] |
| | 125 | | public bool PreferNonstandardArtistsTag { get; set; } |
| | 126 | |
|
| | 127 | | [DefaultValue(false)] |
| | 128 | | public bool UseCustomTagDelimiters { get; set; } |
| | 129 | |
|
| | 130 | | public string[] CustomTagDelimiters { get; set; } |
| | 131 | |
|
| | 132 | | public string[] DelimiterWhitelist { get; set; } |
| | 133 | |
|
| | 134 | | public bool AutomaticallyAddToCollection { get; set; } |
| | 135 | |
|
| | 136 | | public EmbeddedSubtitleOptions AllowEmbeddedSubtitles { get; set; } |
| | 137 | |
|
| | 138 | | public TypeOptions[] TypeOptions { get; set; } |
| | 139 | |
|
| | 140 | | public TypeOptions? GetTypeOptions(string type) |
| | 141 | | { |
| 434 | 142 | | foreach (var options in TypeOptions) |
| | 143 | | { |
| 40 | 144 | | if (string.Equals(options.Type, type, StringComparison.OrdinalIgnoreCase)) |
| | 145 | | { |
| 40 | 146 | | return options; |
| | 147 | | } |
| | 148 | | } |
| | 149 | |
|
| 157 | 150 | | return null; |
| | 151 | | } |
| | 152 | | } |
| | 153 | | } |