gazellegames: added option to search for groupnames only. resolves #5790 (#9747)

This commit is contained in:
seeyabye
2020-10-05 16:01:58 +09:00
committed by GitHub
parent 0742178b23
commit 8b8b89d516

View File

@@ -14,6 +14,7 @@ using Jackett.Common.Utils;
using Jackett.Common.Utils.Clients; using Jackett.Common.Utils.Clients;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using NLog; using NLog;
using static Jackett.Common.Models.IndexerConfig.ConfigurationData;
namespace Jackett.Common.Indexers namespace Jackett.Common.Indexers
{ {
@@ -45,6 +46,8 @@ namespace Jackett.Common.Indexers
Language = "en-us"; Language = "en-us";
Type = "private"; Type = "private";
configData.AddDynamic("searchgroupnames", new BoolItem() { Name = "Search Group Names Only", Value = false });
// Apple // Apple
AddCategoryMapping("Mac", TorznabCatType.ConsoleOther, "Mac"); AddCategoryMapping("Mac", TorznabCatType.ConsoleOther, "Mac");
AddCategoryMapping("iOS", TorznabCatType.PCPhoneIOS, "iOS"); AddCategoryMapping("iOS", TorznabCatType.PCPhoneIOS, "iOS");
@@ -207,9 +210,11 @@ namespace Jackett.Common.Indexers
var searchUrl = BrowseUrl; var searchUrl = BrowseUrl;
var searchString = query.GetQueryString(); var searchString = query.GetQueryString();
var searchType = ((BoolItem)configData.GetDynamic("searchgroupnames")).Value ? "groupname" : "searchstr";
var queryCollection = new NameValueCollection var queryCollection = new NameValueCollection
{ {
{"searchstr", searchString}, {searchType, searchString},
{"order_by", "time"}, {"order_by", "time"},
{"order_way", "desc"}, {"order_way", "desc"},
{"action", "basic"}, {"action", "basic"},
@@ -218,10 +223,8 @@ namespace Jackett.Common.Indexers
var i = 0; var i = 0;
foreach (var cat in MapTorznabCapsToTrackers(query)) foreach (var cat in MapTorznabCapsToTrackers(query))
{ queryCollection.Add($"artistcheck[{i++}]", cat);
queryCollection.Add("artistcheck[" + i + "]", cat);
i++;
}
searchUrl += "?" + queryCollection.GetQueryString(); searchUrl += "?" + queryCollection.GetQueryString();