|
|
@ -20,34 +20,13 @@ namespace NzbDrone.Core.Providers.Core
|
|
|
|
_database = database;
|
|
|
|
_database = database;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public IList<Config> All()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return _database.Fetch<Config>();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public ConfigProvider()
|
|
|
|
public ConfigProvider()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public virtual String ApiKey
|
|
|
|
public IList<Config> All()
|
|
|
|
{
|
|
|
|
|
|
|
|
get { return GetValue("ApiKey"); }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
set { SetValue("ApiKey", value); }
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public virtual String EpisodeNameFormat
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
get { return GetValue("EpisodeNameFormat"); }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
set { SetValue("EpisodeNameFormat", value); }
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public virtual String SeriesRoot
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
get { return GetValue("SeriesRoots"); }
|
|
|
|
return _database.Fetch<Config>();
|
|
|
|
|
|
|
|
|
|
|
|
set { SetValue("SeriesRoots", value); }
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public virtual String NzbMatrixUsername
|
|
|
|
public virtual String NzbMatrixUsername
|
|
|
@ -106,20 +85,6 @@ namespace NzbDrone.Core.Providers.Core
|
|
|
|
set { SetValue("NewzbinPassword", value); }
|
|
|
|
set { SetValue("NewzbinPassword", value); }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public virtual int SyncFrequency
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
get { return GetValueInt("SyncFrequency"); }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
set { SetValue("SyncFrequency", value); }
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public virtual Boolean DownloadPropers
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
get { return GetValueBoolean("DownloadPropers"); }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
set { SetValue("DownloadPropers", value); }
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public virtual String SabHost
|
|
|
|
public virtual String SabHost
|
|
|
|
{
|
|
|
|
{
|
|
|
|
get { return GetValue("SabHost", "localhost"); }
|
|
|
|
get { return GetValue("SabHost", "localhost"); }
|
|
|
@ -176,20 +141,6 @@ namespace NzbDrone.Core.Providers.Core
|
|
|
|
set { SetValue("SabTvDropDirectory", value); }
|
|
|
|
set { SetValue("SabTvDropDirectory", value); }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public virtual Boolean UseBlackhole
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
get { return GetValueBoolean("UseBlackhole"); }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
set { SetValue("UseBlackhole", value); }
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public virtual String BlackholeDirectory
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
get { return GetValue("BlackholeDirectory"); }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
set { SetValue("BlackholeDirectory", value); }
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public virtual bool SortingIncludeSeriesName
|
|
|
|
public virtual bool SortingIncludeSeriesName
|
|
|
|
{
|
|
|
|
{
|
|
|
|
get { return GetValueBoolean("Sorting_SeriesName", true); }
|
|
|
|
get { return GetValueBoolean("Sorting_SeriesName", true); }
|
|
|
@ -252,13 +203,6 @@ namespace NzbDrone.Core.Providers.Core
|
|
|
|
set { SetValue("DefaultQualityProfile", value); }
|
|
|
|
set { SetValue("DefaultQualityProfile", value); }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public virtual Boolean XbmcEnabled
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
get { return GetValueBoolean("XbmcEnabled"); }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
set { SetValue("XbmcEnabled", value); }
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public virtual Boolean XbmcNotifyOnGrab
|
|
|
|
public virtual Boolean XbmcNotifyOnGrab
|
|
|
|
{
|
|
|
|
{
|
|
|
|
get { return GetValueBoolean("XbmcNotifyOnGrab"); }
|
|
|
|
get { return GetValueBoolean("XbmcNotifyOnGrab"); }
|
|
|
@ -328,30 +272,26 @@ namespace NzbDrone.Core.Providers.Core
|
|
|
|
|
|
|
|
|
|
|
|
public virtual string GetValue(string key, object defaultValue)
|
|
|
|
public virtual string GetValue(string key, object defaultValue)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
string value;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var dbValue = _database.SingleOrDefault<Config>("WHERE [Key] =@0", key);
|
|
|
|
var dbValue = _database.SingleOrDefault<Config>("WHERE [Key] =@0", key);
|
|
|
|
|
|
|
|
|
|
|
|
if (dbValue != null && !String.IsNullOrEmpty(dbValue.Value))
|
|
|
|
if (dbValue != null && !String.IsNullOrEmpty(dbValue.Value))
|
|
|
|
return dbValue.Value;
|
|
|
|
return dbValue.Value;
|
|
|
|
|
|
|
|
|
|
|
|
Logger.Trace("Unable to find config key '{0}' defaultValue:'{1}'", key, defaultValue);
|
|
|
|
Logger.Trace("Unable to find config key '{0}' defaultValue:'{1}'", key, defaultValue);
|
|
|
|
value = defaultValue.ToString();
|
|
|
|
return defaultValue.ToString();
|
|
|
|
|
|
|
|
|
|
|
|
return value;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public virtual void SetValue(string key, Boolean value)
|
|
|
|
private void SetValue(string key, Boolean value)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
SetValue(key, value.ToString());
|
|
|
|
SetValue(key, value.ToString());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public virtual void SetValue(string key, int value)
|
|
|
|
private void SetValue(string key, int value)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
SetValue(key, value.ToString());
|
|
|
|
SetValue(key, value.ToString());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public virtual void SetValue(string key, string value)
|
|
|
|
public void SetValue(string key, string value)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (String.IsNullOrEmpty(key))
|
|
|
|
if (String.IsNullOrEmpty(key))
|
|
|
|
throw new ArgumentOutOfRangeException("key");
|
|
|
|
throw new ArgumentOutOfRangeException("key");
|
|
|
|