mirror of
https://github.com/Sonarr/Sonarr.git
synced 2026-04-22 22:16:13 -04:00
New: Setting to allow for grabbing season packs even if some episodes already meet cutoff
Closes #6378
This commit is contained in:
@@ -263,6 +263,18 @@ namespace NzbDrone.Core.Configuration
|
||||
set { SetValue("UserRejectedExtensions", value); }
|
||||
}
|
||||
|
||||
public SeasonPackUpgradeType SeasonPackUpgrade
|
||||
{
|
||||
get { return GetValueEnum("SeasonPackUpgrade", SeasonPackUpgradeType.All); }
|
||||
set { SetValue("SeasonPackUpgrade", value); }
|
||||
}
|
||||
|
||||
public double SeasonPackUpgradeThreshold
|
||||
{
|
||||
get { return GetValueDouble("SeasonPackUpgradeThreshold", 100.0); }
|
||||
set { SetValue("SeasonPackUpgradeThreshold", value); }
|
||||
}
|
||||
|
||||
public bool SetPermissionsLinux
|
||||
{
|
||||
get { return GetValueBoolean("SetPermissionsLinux", false); }
|
||||
@@ -417,6 +429,11 @@ namespace NzbDrone.Core.Configuration
|
||||
return Convert.ToInt32(GetValue(key, defaultValue));
|
||||
}
|
||||
|
||||
private double GetValueDouble(string key, double defaultValue = 0)
|
||||
{
|
||||
return Convert.ToDouble(GetValue(key, defaultValue), CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
private T GetValueEnum<T>(string key, T defaultValue)
|
||||
{
|
||||
return (T)Enum.Parse(typeof(T), GetValue(key, defaultValue), true);
|
||||
@@ -454,6 +471,11 @@ namespace NzbDrone.Core.Configuration
|
||||
SetValue(key, value.ToString());
|
||||
}
|
||||
|
||||
private void SetValue(string key, double value)
|
||||
{
|
||||
SetValue(key, value.ToString(CultureInfo.InvariantCulture));
|
||||
}
|
||||
|
||||
private void SetValue(string key, Enum value)
|
||||
{
|
||||
SetValue(key, value.ToString().ToLower());
|
||||
|
||||
Reference in New Issue
Block a user