1
0
Fork 0
mirror of https://github.com/Jackett/Jackett synced 2025-02-24 15:21:06 +00:00

add configured option for t=indexers

This commit is contained in:
kaso17 2018-04-07 17:54:42 +02:00
parent 48279699eb
commit 280547ad01
2 changed files with 7 additions and 1 deletions

View file

@ -21,6 +21,7 @@ namespace Jackett.Common.Models.DTO
public string track { get; set; }
public string year { get; set; }
public string genre { get; set; }
public string configured { get; set; }
public static TorznabQuery ToTorznabQuery(TorznabRequest request)
{

View file

@ -258,11 +258,16 @@ namespace Jackett.Controllers
return GetErrorXML(203, "Function Not Available: this isn't a meta indexer");
}
var CurrentBaseMetaIndexer = (BaseMetaIndexer)CurrentIndexer;
var indexers = CurrentBaseMetaIndexer.Indexers;
if (string.Equals(request.configured, "true", StringComparison.InvariantCultureIgnoreCase))
indexers = indexers.Where(i => i.IsConfigured);
else if (string.Equals(request.configured, "false", StringComparison.InvariantCultureIgnoreCase))
indexers = indexers.Where(i => !i.IsConfigured);
var xdoc = new XDocument(
new XDeclaration("1.0", "UTF-8", null),
new XElement("indexers",
from i in CurrentBaseMetaIndexer.Indexers
from i in indexers
select new XElement("indexer",
new XAttribute("id", i.ID),
new XAttribute("configured", i.IsConfigured),