diff --git a/OF DL.Core/Enumerations/Theme.cs b/OF DL.Core/Enumerations/Theme.cs index 7e7eefc..36c4fed 100644 --- a/OF DL.Core/Enumerations/Theme.cs +++ b/OF DL.Core/Enumerations/Theme.cs @@ -1,3 +1,5 @@ +// ReSharper disable InconsistentNaming + namespace OF_DL.Enumerations; public enum Theme diff --git a/OF DL.Core/Models/Config/Config.cs b/OF DL.Core/Models/Config/Config.cs index 78dcf3a..4453b40 100644 --- a/OF DL.Core/Models/Config/Config.cs +++ b/OF DL.Core/Models/Config/Config.cs @@ -90,7 +90,7 @@ public class Config : IFileNameFormatConfig public LoggingLevel LoggingLevel { get; set; } = LoggingLevel.Error; [JsonConverter(typeof(StringEnumConverter))] - public Theme Theme { get; set; } = Theme.light; + public Theme Theme { get; set; } = Theme.dark; [ToggleableConfig] public bool HideMissingCdmKeysWarning { get; set; } diff --git a/OF DL.Core/Services/ConfigService.cs b/OF DL.Core/Services/ConfigService.cs index f46ff4b..018df3e 100644 --- a/OF DL.Core/Services/ConfigService.cs +++ b/OF DL.Core/Services/ConfigService.cs @@ -237,7 +237,7 @@ public class ConfigService(ILoggingService loggingService) : IConfigService DownloadLimitInMbPerSec = hoconConfig.GetInt("Performance.DownloadLimitInMbPerSec"), // Appearance Settings - Theme = ParseTheme(hoconConfig.GetString("Appearance.Theme", "light")), + Theme = ParseTheme(hoconConfig.GetString("Appearance.Theme", "dark")), HideMissingCdmKeysWarning = bool.TryParse(hoconConfig.GetString("Appearance.HideMissingCdmKeysWarning", "false"), out bool hideMissingCdmKeysWarning) && hideMissingCdmKeysWarning, @@ -502,25 +502,12 @@ public class ConfigService(ILoggingService loggingService) : IConfigService return configChanged; } - private VideoResolution ParseVideoResolution(string value) - { - if (value.Equals("source", StringComparison.OrdinalIgnoreCase)) - { - return VideoResolution.source; - } + private VideoResolution ParseVideoResolution(string value) => + value.Equals("source", StringComparison.OrdinalIgnoreCase) + ? VideoResolution.source + : Enum.Parse("_" + value, true); - return Enum.Parse("_" + value, true); - } - - private static Theme ParseTheme(string value) - { - if (Enum.TryParse(value, true, out Theme theme)) - { - return theme; - } - - return Theme.light; - } + private static Theme ParseTheme(string value) => Enum.TryParse(value, true, out Theme theme) ? theme : Theme.dark; private static double ParseDrmVideoDurationMatchThreshold(string value) => !double.TryParse(value, NumberStyles.Float, CultureInfo.InvariantCulture, out double parsed) diff --git a/OF DL.Tests/Services/ConfigServiceTests.cs b/OF DL.Tests/Services/ConfigServiceTests.cs index 2a1fba2..d7a881d 100644 --- a/OF DL.Tests/Services/ConfigServiceTests.cs +++ b/OF DL.Tests/Services/ConfigServiceTests.cs @@ -23,7 +23,7 @@ public class ConfigServiceTests Assert.Equal(service.CurrentConfig.LoggingLevel, loggingService.LastLevel); Assert.Equal("", service.CurrentConfig.FFprobePath); Assert.Equal(0.98, service.CurrentConfig.DrmVideoDurationMatchThreshold, 3); - Assert.Equal(Theme.light, service.CurrentConfig.Theme); + Assert.Equal(Theme.dark, service.CurrentConfig.Theme); Assert.False(service.CurrentConfig.HideMissingCdmKeysWarning); } @@ -142,5 +142,4 @@ public class ConfigServiceTests Assert.Equal("/downloads", service.CurrentConfig.DownloadPath); Assert.Equal(LoggingLevel.Warning, loggingService.LastLevel); } - } diff --git a/docs/config/all-configuration-options.md b/docs/config/all-configuration-options.md index 226df1c..e8ca2ba 100644 --- a/docs/config/all-configuration-options.md +++ b/docs/config/all-configuration-options.md @@ -597,7 +597,7 @@ Description: Posts and messages that contain #ad or free trial links will be ign Type: `string` -Default: `"light"` +Default: `"dark"` Allowed values: `"light"`, `"dark"`