mirror of
https://github.com/Sonarr/Sonarr.git
synced 2026-04-21 22:05:38 -04:00
New: Set Instance Name
This commit is contained in:
committed by
Mark McDowall
parent
6c0f22a11e
commit
4a2f120bc1
@@ -39,6 +39,7 @@ namespace NzbDrone.Core.Configuration
|
||||
string SslCertHash { get; }
|
||||
string UrlBase { get; }
|
||||
string UiFolder { get; }
|
||||
string InstanceName { get; }
|
||||
bool UpdateAutomatically { get; }
|
||||
UpdateMechanism UpdateMechanism { get; }
|
||||
string UpdateScriptPath { get; }
|
||||
@@ -205,6 +206,19 @@ namespace NzbDrone.Core.Configuration
|
||||
// public string UiFolder => GetValue("UiFolder", "UI", false);GetValue("UiFolder", "UI", false);
|
||||
public string UiFolder => "UI";
|
||||
|
||||
public string InstanceName
|
||||
{
|
||||
get
|
||||
{
|
||||
var instanceName = GetValue("InstanceName", BuildInfo.AppName);
|
||||
|
||||
if (instanceName.StartsWith(BuildInfo.AppName) || instanceName.EndsWith(BuildInfo.AppName) )
|
||||
{
|
||||
return instanceName;
|
||||
}
|
||||
return BuildInfo.AppName;
|
||||
}
|
||||
}
|
||||
|
||||
public bool UpdateAutomatically => GetValueBoolean("UpdateAutomatically", false, false);
|
||||
|
||||
@@ -218,7 +232,6 @@ namespace NzbDrone.Core.Configuration
|
||||
|
||||
public string SyslogLevel => GetValue("SyslogLevel", LogLevel, persist: false).ToLowerInvariant();
|
||||
|
||||
|
||||
public int GetValueInt(string key, int defaultValue, bool persist = true)
|
||||
{
|
||||
return Convert.ToInt32(GetValue(key, defaultValue));
|
||||
|
||||
Reference in New Issue
Block a user