sonarr-repo-only/NzbDrone.Api/Indexers/IndexerSchemaModule.cs

39 lines
1.2 KiB
C#
Raw Normal View History

2013-05-28 00:19:07 +00:00
using System.Collections.Generic;
using NzbDrone.Api.ClientSchema;
using NzbDrone.Core.Indexers;
using Omu.ValueInjecter;
namespace NzbDrone.Api.Indexers
{
public class IndexerSchemaModule : NzbDroneRestModule<IndexerResource>
{
private readonly IIndexerService _indexerService;
public IndexerSchemaModule(IIndexerService indexerService)
: base("indexer/schema")
{
_indexerService = indexerService;
GetResourceAll = GetSchema;
}
private List<IndexerResource> GetSchema()
{
2013-09-22 05:20:26 +00:00
/* var indexers = _indexerService.Schema();
2013-05-28 00:19:07 +00:00
2013-09-22 05:20:26 +00:00
var result = new List<IndexerResource>(indexers.Count);
2013-05-28 00:19:07 +00:00
2013-09-22 05:20:26 +00:00
foreach (var indexer in indexers)
{
var indexerResource = new IndexerResource();
indexerResource.InjectFrom(indexer);
indexerResource.Fields = SchemaBuilder.GenerateSchema(indexer.Settings);
2013-05-28 00:19:07 +00:00
2013-09-22 05:20:26 +00:00
result.Add(indexerResource);
}
2013-05-28 00:19:07 +00:00
2013-09-22 05:20:26 +00:00
return result;*/
return null;
2013-05-28 00:19:07 +00:00
}
}
}