From 8b8b89d51608fc3261a6faba5702a947c2be5f53 Mon Sep 17 00:00:00 2001 From: seeyabye Date: Mon, 5 Oct 2020 16:01:58 +0900 Subject: [PATCH] gazellegames: added option to search for groupnames only. resolves #5790 (#9747) --- src/Jackett.Common/Indexers/GazelleGames.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Jackett.Common/Indexers/GazelleGames.cs b/src/Jackett.Common/Indexers/GazelleGames.cs index e066d325a..e62a9ee5e 100644 --- a/src/Jackett.Common/Indexers/GazelleGames.cs +++ b/src/Jackett.Common/Indexers/GazelleGames.cs @@ -14,6 +14,7 @@ using Jackett.Common.Utils; using Jackett.Common.Utils.Clients; using Newtonsoft.Json.Linq; using NLog; +using static Jackett.Common.Models.IndexerConfig.ConfigurationData; namespace Jackett.Common.Indexers { @@ -45,6 +46,8 @@ namespace Jackett.Common.Indexers Language = "en-us"; Type = "private"; + configData.AddDynamic("searchgroupnames", new BoolItem() { Name = "Search Group Names Only", Value = false }); + // Apple AddCategoryMapping("Mac", TorznabCatType.ConsoleOther, "Mac"); AddCategoryMapping("iOS", TorznabCatType.PCPhoneIOS, "iOS"); @@ -207,9 +210,11 @@ namespace Jackett.Common.Indexers var searchUrl = BrowseUrl; var searchString = query.GetQueryString(); + var searchType = ((BoolItem)configData.GetDynamic("searchgroupnames")).Value ? "groupname" : "searchstr"; + var queryCollection = new NameValueCollection { - {"searchstr", searchString}, + {searchType, searchString}, {"order_by", "time"}, {"order_way", "desc"}, {"action", "basic"}, @@ -218,10 +223,8 @@ namespace Jackett.Common.Indexers var i = 0; foreach (var cat in MapTorznabCapsToTrackers(query)) - { - queryCollection.Add("artistcheck[" + i + "]", cat); - i++; - } + queryCollection.Add($"artistcheck[{i++}]", cat); + searchUrl += "?" + queryCollection.GetQueryString();