1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-04-20 21:54:58 -04:00

Optionally show mini profiler

This commit is contained in:
Mark McDowall
2025-12-25 18:33:31 -08:00
parent 8fcab2d321
commit c3706c3c92
19 changed files with 137 additions and 25 deletions
@@ -69,6 +69,8 @@ namespace NzbDrone.Core.Configuration
string PostgresMainDbConnectionString { get; }
string PostgresLogDbConnectionString { get; }
bool TrustCgnatIpAddresses { get; }
bool ProfilerEnabled { get; }
string ProfilerPosition { get; }
}
public class ConfigFileProvider : IConfigFileProvider
@@ -234,6 +236,8 @@ namespace NzbDrone.Core.Configuration
? enumValue
: GetValueEnum("AuthenticationRequired", AuthenticationRequiredType.Enabled);
public bool TrustCgnatIpAddresses => _authOptions.TrustCgnatIpAddresses ?? GetValueBoolean("TrustCgnatIpAddresses", false, persist: false);
public bool AnalyticsEnabled => _logOptions.AnalyticsEnabled ?? GetValueBoolean("AnalyticsEnabled", true, persist: false);
public string Branch => _updateOptions.Branch ?? GetValue("Branch", "main").ToLowerInvariant();
@@ -312,6 +316,9 @@ namespace NzbDrone.Core.Configuration
public string SyslogLevel => _logOptions.SyslogLevel ?? GetValue("SyslogLevel", LogLevel, persist: false).ToLowerInvariant();
public bool ProfilerEnabled => _appOptions.ProfilerEnabled ?? GetValueBoolean("ProfilerEnabled", false, persist: false);
public string ProfilerPosition => _appOptions.ProfilerPosition ?? GetValue("ProfilerPosition", "bottom-right", persist: false);
public int GetValueInt(string key, int defaultValue, bool persist = true)
{
return Convert.ToInt32(GetValue(key, defaultValue, persist));
@@ -499,7 +506,5 @@ namespace NzbDrone.Core.Configuration
{
SetValue("ApiKey", GenerateApiKey());
}
public bool TrustCgnatIpAddresses => _authOptions.TrustCgnatIpAddresses ?? GetValueBoolean("TrustCgnatIpAddresses", false, persist: false);
}
}