rewrite of indexer/episode search

This commit is contained in:
kay.one
2013-04-07 00:30:37 -07:00
parent 9ae21cf7a1
commit a6a4932b44
114 changed files with 2045 additions and 5577 deletions

View File

@@ -0,0 +1,25 @@
using Newtonsoft.Json;
namespace NzbDrone.Core.Indexers
{
public interface IProviderIndexerSetting
{
TSetting Get<TSetting>(IIndexerBase indexer) where TSetting : IIndexerSetting, new();
}
public class IndexerSettingProvider : IProviderIndexerSetting
{
private readonly IIndexerRepository _indexerRepository;
public IndexerSettingProvider(IIndexerRepository indexerRepository)
{
_indexerRepository = indexerRepository;
}
public TSetting Get<TSetting>(IIndexerBase indexer) where TSetting : IIndexerSetting, new()
{
var json = _indexerRepository.Get(indexer.Name).Settings;
return JsonConvert.DeserializeObject<TSetting>(json);
}
}
}