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