Implemented torznab capabilities feature

This commit is contained in:
unknown
2015-07-19 17:05:30 -06:00
parent 507e0d5496
commit 5fb7e3a2ae
32 changed files with 402 additions and 272 deletions

View File

@@ -17,7 +17,7 @@ namespace Jackett.Controllers
private IIndexerManagerService indexerService;
private Logger logger;
public APIController(IIndexerManagerService i, Logger l)
public APIController(IIndexerManagerService i, Logger l)
{
indexerService = i;
logger = l;
@@ -29,9 +29,12 @@ namespace Jackett.Controllers
var indexer = indexerService.GetIndexer(indexerName);
var torznabQuery = TorznabQuery.FromHttpQuery(HttpUtility.ParseQueryString(Request.RequestUri.Query));
if (torznabQuery.RageIDLookupEnabled && indexer.RequiresRageIDLookupDisabled)
if (torznabQuery.QueryType == "caps")
{
throw new ArgumentException("This indexer requires RageID lookup disabled");
return new HttpResponseMessage()
{
Content = new StringContent(indexer.TorznabCaps.ToXml(), Encoding.UTF8, "application/rss+xml")
};
}
var releases = await indexer.PerformQuery(torznabQuery);