| | | 1 | | #pragma warning disable CS1591 |
| | | 2 | | #pragma warning disable CA1819 |
| | | 3 | | |
| | | 4 | | using System; |
| | | 5 | | using MediaBrowser.Model.Drawing; |
| | | 6 | | using MediaBrowser.Model.Dto; |
| | | 7 | | using MediaBrowser.Model.System; |
| | | 8 | | using MediaBrowser.Model.Updates; |
| | | 9 | | |
| | | 10 | | namespace MediaBrowser.Model.Configuration; |
| | | 11 | | |
| | | 12 | | /// <summary> |
| | | 13 | | /// Represents the server configuration. |
| | | 14 | | /// </summary> |
| | | 15 | | public class ServerConfiguration : BaseApplicationConfiguration |
| | | 16 | | { |
| | | 17 | | /// <summary> |
| | | 18 | | /// Initializes a new instance of the <see cref="ServerConfiguration" /> class. |
| | | 19 | | /// </summary> |
| | 207 | 20 | | public ServerConfiguration() |
| | | 21 | | { |
| | 207 | 22 | | MetadataOptions = new[] |
| | 207 | 23 | | { |
| | 207 | 24 | | new MetadataOptions() |
| | 207 | 25 | | { |
| | 207 | 26 | | ItemType = "Book" |
| | 207 | 27 | | }, |
| | 207 | 28 | | new MetadataOptions() |
| | 207 | 29 | | { |
| | 207 | 30 | | ItemType = "Movie" |
| | 207 | 31 | | }, |
| | 207 | 32 | | new MetadataOptions |
| | 207 | 33 | | { |
| | 207 | 34 | | ItemType = "MusicVideo", |
| | 207 | 35 | | DisabledMetadataFetchers = new[] { "The Open Movie Database" }, |
| | 207 | 36 | | DisabledImageFetchers = new[] { "The Open Movie Database" } |
| | 207 | 37 | | }, |
| | 207 | 38 | | new MetadataOptions |
| | 207 | 39 | | { |
| | 207 | 40 | | ItemType = "Series", |
| | 207 | 41 | | }, |
| | 207 | 42 | | new MetadataOptions |
| | 207 | 43 | | { |
| | 207 | 44 | | ItemType = "MusicAlbum", |
| | 207 | 45 | | DisabledMetadataFetchers = new[] { "TheAudioDB" } |
| | 207 | 46 | | }, |
| | 207 | 47 | | new MetadataOptions |
| | 207 | 48 | | { |
| | 207 | 49 | | ItemType = "MusicArtist", |
| | 207 | 50 | | DisabledMetadataFetchers = new[] { "TheAudioDB" } |
| | 207 | 51 | | }, |
| | 207 | 52 | | new MetadataOptions |
| | 207 | 53 | | { |
| | 207 | 54 | | ItemType = "BoxSet" |
| | 207 | 55 | | }, |
| | 207 | 56 | | new MetadataOptions |
| | 207 | 57 | | { |
| | 207 | 58 | | ItemType = "Season", |
| | 207 | 59 | | }, |
| | 207 | 60 | | new MetadataOptions |
| | 207 | 61 | | { |
| | 207 | 62 | | ItemType = "Episode", |
| | 207 | 63 | | } |
| | 207 | 64 | | }; |
| | 207 | 65 | | } |
| | | 66 | | |
| | | 67 | | /// <summary> |
| | | 68 | | /// Gets or sets a value indicating whether to enable prometheus metrics exporting. |
| | | 69 | | /// </summary> |
| | | 70 | | public bool EnableMetrics { get; set; } = false; |
| | | 71 | | |
| | | 72 | | public bool EnableNormalizedItemByNameIds { get; set; } = true; |
| | | 73 | | |
| | | 74 | | /// <summary> |
| | | 75 | | /// Gets or sets a value indicating whether this instance is port authorized. |
| | | 76 | | /// </summary> |
| | | 77 | | /// <value><c>true</c> if this instance is port authorized; otherwise, <c>false</c>.</value> |
| | | 78 | | public bool IsPortAuthorized { get; set; } |
| | | 79 | | |
| | | 80 | | /// <summary> |
| | | 81 | | /// Gets or sets a value indicating whether quick connect is available for use on this server. |
| | | 82 | | /// </summary> |
| | | 83 | | public bool QuickConnectAvailable { get; set; } = true; |
| | | 84 | | |
| | | 85 | | /// <summary> |
| | | 86 | | /// Gets or sets a value indicating whether [enable case-sensitive item ids]. |
| | | 87 | | /// </summary> |
| | | 88 | | /// <value><c>true</c> if [enable case-sensitive item ids]; otherwise, <c>false</c>.</value> |
| | | 89 | | public bool EnableCaseSensitiveItemIds { get; set; } = true; |
| | | 90 | | |
| | | 91 | | public bool DisableLiveTvChannelUserDataName { get; set; } = true; |
| | | 92 | | |
| | | 93 | | /// <summary> |
| | | 94 | | /// Gets or sets the metadata path. |
| | | 95 | | /// </summary> |
| | | 96 | | /// <value>The metadata path.</value> |
| | | 97 | | public string MetadataPath { get; set; } = string.Empty; |
| | | 98 | | |
| | | 99 | | /// <summary> |
| | | 100 | | /// Gets or sets the preferred metadata language. |
| | | 101 | | /// </summary> |
| | | 102 | | /// <value>The preferred metadata language.</value> |
| | | 103 | | public string PreferredMetadataLanguage { get; set; } = "en"; |
| | | 104 | | |
| | | 105 | | /// <summary> |
| | | 106 | | /// Gets or sets the metadata country code. |
| | | 107 | | /// </summary> |
| | | 108 | | /// <value>The metadata country code.</value> |
| | | 109 | | public string MetadataCountryCode { get; set; } = "US"; |
| | | 110 | | |
| | | 111 | | /// <summary> |
| | | 112 | | /// Gets or sets characters to be replaced with a ' ' in strings to create a sort name. |
| | | 113 | | /// </summary> |
| | | 114 | | /// <value>The sort replace characters.</value> |
| | 207 | 115 | | public string[] SortReplaceCharacters { get; set; } = new[] { ".", "+", "%" }; |
| | | 116 | | |
| | | 117 | | /// <summary> |
| | | 118 | | /// Gets or sets characters to be removed from strings to create a sort name. |
| | | 119 | | /// </summary> |
| | | 120 | | /// <value>The sort remove characters.</value> |
| | 207 | 121 | | public string[] SortRemoveCharacters { get; set; } = new[] { ",", "&", "-", "{", "}", "'" }; |
| | | 122 | | |
| | | 123 | | /// <summary> |
| | | 124 | | /// Gets or sets words to be removed from strings to create a sort name. |
| | | 125 | | /// </summary> |
| | | 126 | | /// <value>The sort remove words.</value> |
| | 207 | 127 | | public string[] SortRemoveWords { get; set; } = new[] { "the", "a", "an" }; |
| | | 128 | | |
| | | 129 | | /// <summary> |
| | | 130 | | /// Gets or sets the minimum percentage of an item that must be played in order for playstate to be updated. |
| | | 131 | | /// </summary> |
| | | 132 | | /// <value>The min resume PCT.</value> |
| | | 133 | | public int MinResumePct { get; set; } = 5; |
| | | 134 | | |
| | | 135 | | /// <summary> |
| | | 136 | | /// Gets or sets the maximum percentage of an item that can be played while still saving playstate. If this percenta |
| | | 137 | | /// </summary> |
| | | 138 | | /// <value>The max resume PCT.</value> |
| | | 139 | | public int MaxResumePct { get; set; } = 90; |
| | | 140 | | |
| | | 141 | | /// <summary> |
| | | 142 | | /// Gets or sets the minimum duration that an item must have in order to be eligible for playstate updates.. |
| | | 143 | | /// </summary> |
| | | 144 | | /// <value>The min resume duration seconds.</value> |
| | | 145 | | public int MinResumeDurationSeconds { get; set; } = 300; |
| | | 146 | | |
| | | 147 | | /// <summary> |
| | | 148 | | /// Gets or sets the minimum minutes of a book that must be played in order for playstate to be updated. |
| | | 149 | | /// </summary> |
| | | 150 | | /// <value>The min resume in minutes.</value> |
| | | 151 | | public int MinAudiobookResume { get; set; } = 5; |
| | | 152 | | |
| | | 153 | | /// <summary> |
| | | 154 | | /// Gets or sets the remaining minutes of a book that can be played while still saving playstate. If this percentage |
| | | 155 | | /// </summary> |
| | | 156 | | /// <value>The remaining time in minutes.</value> |
| | | 157 | | public int MaxAudiobookResume { get; set; } = 5; |
| | | 158 | | |
| | | 159 | | /// <summary> |
| | | 160 | | /// Gets or sets the threshold in minutes after a inactive session gets closed automatically. |
| | | 161 | | /// If set to 0 the check for inactive sessions gets disabled. |
| | | 162 | | /// </summary> |
| | | 163 | | /// <value>The close inactive session threshold in minutes. 0 to disable.</value> |
| | | 164 | | public int InactiveSessionThreshold { get; set; } |
| | | 165 | | |
| | | 166 | | /// <summary> |
| | | 167 | | /// Gets or sets the delay in seconds that we will wait after a file system change to try and discover what has been |
| | | 168 | | /// Some delay is necessary with some items because their creation is not atomic. It involves the creation of sever |
| | | 169 | | /// different directories and files. |
| | | 170 | | /// </summary> |
| | | 171 | | /// <value>The file watcher delay.</value> |
| | | 172 | | public int LibraryMonitorDelay { get; set; } = 60; |
| | | 173 | | |
| | | 174 | | /// <summary> |
| | | 175 | | /// Gets or sets the duration in seconds that we will wait after a library updated event before executing the librar |
| | | 176 | | /// </summary> |
| | | 177 | | /// <value>The library update duration.</value> |
| | | 178 | | public int LibraryUpdateDuration { get; set; } = 30; |
| | | 179 | | |
| | | 180 | | /// <summary> |
| | | 181 | | /// Gets or sets the maximum amount of items to cache. |
| | | 182 | | /// </summary> |
| | 207 | 183 | | public int CacheSize { get; set; } = Environment.ProcessorCount * 100; |
| | | 184 | | |
| | | 185 | | /// <summary> |
| | | 186 | | /// Gets or sets the image saving convention. |
| | | 187 | | /// </summary> |
| | | 188 | | /// <value>The image saving convention.</value> |
| | | 189 | | public ImageSavingConvention ImageSavingConvention { get; set; } |
| | | 190 | | |
| | | 191 | | public MetadataOptions[] MetadataOptions { get; set; } |
| | | 192 | | |
| | | 193 | | public bool SkipDeserializationForBasicTypes { get; set; } = true; |
| | | 194 | | |
| | | 195 | | public string ServerName { get; set; } = string.Empty; |
| | | 196 | | |
| | | 197 | | public string UICulture { get; set; } = "en-US"; |
| | | 198 | | |
| | | 199 | | public bool SaveMetadataHidden { get; set; } = false; |
| | | 200 | | |
| | | 201 | | public NameValuePair[] ContentTypes { get; set; } = Array.Empty<NameValuePair>(); |
| | | 202 | | |
| | | 203 | | public int RemoteClientBitrateLimit { get; set; } |
| | | 204 | | |
| | | 205 | | public bool EnableFolderView { get; set; } = false; |
| | | 206 | | |
| | | 207 | | public bool EnableGroupingMoviesIntoCollections { get; set; } = false; |
| | | 208 | | |
| | | 209 | | public bool EnableGroupingShowsIntoCollections { get; set; } = false; |
| | | 210 | | |
| | | 211 | | public bool DisplaySpecialsWithinSeasons { get; set; } = true; |
| | | 212 | | |
| | | 213 | | public string[] CodecsUsed { get; set; } = Array.Empty<string>(); |
| | | 214 | | |
| | | 215 | | public RepositoryInfo[] PluginRepositories { get; set; } = Array.Empty<RepositoryInfo>(); |
| | | 216 | | |
| | | 217 | | public bool EnableExternalContentInSuggestions { get; set; } = true; |
| | | 218 | | |
| | | 219 | | public int ImageExtractionTimeoutMs { get; set; } |
| | | 220 | | |
| | | 221 | | public PathSubstitution[] PathSubstitutions { get; set; } = Array.Empty<PathSubstitution>(); |
| | | 222 | | |
| | | 223 | | /// <summary> |
| | | 224 | | /// Gets or sets a value indicating whether slow server responses should be logged as a warning. |
| | | 225 | | /// </summary> |
| | | 226 | | public bool EnableSlowResponseWarning { get; set; } = true; |
| | | 227 | | |
| | | 228 | | /// <summary> |
| | | 229 | | /// Gets or sets the threshold for the slow response time warning in ms. |
| | | 230 | | /// </summary> |
| | 207 | 231 | | public long SlowResponseThresholdMs { get; set; } = 500; |
| | | 232 | | |
| | | 233 | | /// <summary> |
| | | 234 | | /// Gets or sets the cors hosts. |
| | | 235 | | /// </summary> |
| | 207 | 236 | | public string[] CorsHosts { get; set; } = new[] { "*" }; |
| | | 237 | | |
| | | 238 | | /// <summary> |
| | | 239 | | /// Gets or sets the number of days we should retain activity logs. |
| | | 240 | | /// </summary> |
| | 207 | 241 | | public int? ActivityLogRetentionDays { get; set; } = 30; |
| | | 242 | | |
| | | 243 | | /// <summary> |
| | | 244 | | /// Gets or sets the how the library scan fans out. |
| | | 245 | | /// </summary> |
| | | 246 | | public int LibraryScanFanoutConcurrency { get; set; } |
| | | 247 | | |
| | | 248 | | /// <summary> |
| | | 249 | | /// Gets or sets the how many metadata refreshes can run concurrently. |
| | | 250 | | /// </summary> |
| | | 251 | | public int LibraryMetadataRefreshConcurrency { get; set; } |
| | | 252 | | |
| | | 253 | | /// <summary> |
| | | 254 | | /// Gets or sets a value indicating whether clients should be allowed to upload logs. |
| | | 255 | | /// </summary> |
| | | 256 | | public bool AllowClientLogUpload { get; set; } = true; |
| | | 257 | | |
| | | 258 | | /// <summary> |
| | | 259 | | /// Gets or sets the dummy chapter duration in seconds, use 0 (zero) or less to disable generation altogether. |
| | | 260 | | /// </summary> |
| | | 261 | | /// <value>The dummy chapters duration.</value> |
| | | 262 | | public int DummyChapterDuration { get; set; } |
| | | 263 | | |
| | | 264 | | /// <summary> |
| | | 265 | | /// Gets or sets the chapter image resolution. |
| | | 266 | | /// </summary> |
| | | 267 | | /// <value>The chapter image resolution.</value> |
| | | 268 | | public ImageResolution ChapterImageResolution { get; set; } = ImageResolution.MatchSource; |
| | | 269 | | |
| | | 270 | | /// <summary> |
| | | 271 | | /// Gets or sets the limit for parallel image encoding. |
| | | 272 | | /// </summary> |
| | | 273 | | /// <value>The limit for parallel image encoding.</value> |
| | | 274 | | public int ParallelImageEncodingLimit { get; set; } |
| | | 275 | | |
| | | 276 | | /// <summary> |
| | | 277 | | /// Gets or sets the list of cast receiver applications. |
| | | 278 | | /// </summary> |
| | | 279 | | public CastReceiverApplication[] CastReceiverApplications { get; set; } = Array.Empty<CastReceiverApplication>(); |
| | | 280 | | |
| | | 281 | | /// <summary> |
| | | 282 | | /// Gets or sets the trickplay options. |
| | | 283 | | /// </summary> |
| | | 284 | | /// <value>The trickplay options.</value> |
| | | 285 | | public TrickplayOptions TrickplayOptions { get; set; } = new TrickplayOptions(); |
| | | 286 | | |
| | | 287 | | /// <summary> |
| | | 288 | | /// Gets or sets a value indicating whether old authorization methods are allowed. |
| | | 289 | | /// </summary> |
| | | 290 | | public bool EnableLegacyAuthorization { get; set; } = true; |
| | | 291 | | } |