2013-05-02 01:59:09 +00:00
|
|
|
using NzbDrone.Common;
|
2013-05-12 15:18:17 +00:00
|
|
|
using NzbDrone.Common.Serializer;
|
2013-04-10 23:44:48 +00:00
|
|
|
|
|
|
|
namespace NzbDrone.Core.Indexers
|
|
|
|
{
|
2013-05-02 01:59:09 +00:00
|
|
|
public abstract class IndexerWithSetting<TSetting> : IndexerBase where TSetting : class, IIndexerSetting, new()
|
2013-04-10 23:44:48 +00:00
|
|
|
{
|
2013-06-04 03:33:03 +00:00
|
|
|
public TSetting Settings { get; set; }
|
2013-04-10 23:44:48 +00:00
|
|
|
|
2013-05-02 01:59:09 +00:00
|
|
|
public TSetting ImportSettingsFromJson(string json)
|
2013-04-10 23:44:48 +00:00
|
|
|
{
|
2013-05-13 02:52:55 +00:00
|
|
|
Settings = Json.Deserialize<TSetting>(json) ?? new TSetting();
|
2013-05-02 01:59:09 +00:00
|
|
|
|
|
|
|
return Settings;
|
2013-04-10 23:44:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|