2013-05-01 18:59:09 -07:00
|
|
|
using NzbDrone.Common;
|
2013-04-10 16:44:48 -07:00
|
|
|
|
|
|
|
namespace NzbDrone.Core.Indexers
|
|
|
|
{
|
2013-05-01 18:59:09 -07:00
|
|
|
public abstract class IndexerWithSetting<TSetting> : IndexerBase where TSetting : class, IIndexerSetting, new()
|
2013-04-10 16:44:48 -07:00
|
|
|
{
|
2013-04-27 17:25:28 -07:00
|
|
|
public TSetting Settings { get; private set; }
|
2013-04-10 16:44:48 -07:00
|
|
|
|
2013-05-01 18:59:09 -07:00
|
|
|
public TSetting ImportSettingsFromJson(string json)
|
2013-04-10 16:44:48 -07:00
|
|
|
{
|
2013-05-01 18:59:09 -07:00
|
|
|
Settings = new JsonSerializer().Deserialize<TSetting>(json) ?? new TSetting();
|
|
|
|
|
|
|
|
return Settings;
|
2013-04-10 16:44:48 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|