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