funfile: use ternary operator for freeleech search. #9456

a8083062ad

https://github.com/Jackett/Jackett/pull/14200#discussion_r1154787984
This commit is contained in:
ilike2burnthing
2023-03-31 20:03:33 +01:00
committed by GitHub
parent 242dcee190
commit bdf6212ec3

View File

@@ -161,18 +161,11 @@ namespace Jackett.Common.Indexers
var qc = new NameValueCollection var qc = new NameValueCollection
{ {
{ "cat", "0" }, { "cat", "0" },
// incldead= 0 active, 1 incldead, 2 deadonly, 3 freeleech, 4 sceneonly, 5 requestsonly, 8 packsonly
{ "incldead", ((BoolConfigurationItem)configData.GetDynamic("freeleech")).Value ? "3" : "1" },
{ "showspam", "1" }, { "showspam", "1" },
{ "s_title", "1" } { "s_title", "1" }
}; };
// incldead= 0 active, 1 incldead, 2 deadonly, 3 freeleech, 4 sceneonly, 5 requestsonly, 8 packsonly
if (((BoolConfigurationItem)configData.GetDynamic("freeleech")).Value)
{
qc.Set("incldead", "3");
}
else
{
qc.Set("incldead", "1");
}
var queryCats = MapTorznabCapsToTrackers(query); var queryCats = MapTorznabCapsToTrackers(query);
queryCats.ForEach(cat => qc.Set($"c{cat}", "1")); queryCats.ForEach(cat => qc.Set($"c{cat}", "1"));