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