mirror of
https://github.com/Prowlarr/Prowlarr
synced 2025-12-28 11:24:40 +01:00
New: (GazelleGames) Freeleech only option
This commit is contained in:
parent
742dd5ff54
commit
1da3954879
2 changed files with 19 additions and 3 deletions
|
|
@ -324,6 +324,11 @@ private List<KeyValuePair<string, string>> GetBasicSearchParameters(string searc
|
|||
categoryMappings.ForEach(category => parameters.Add("artistcheck[]", category));
|
||||
}
|
||||
|
||||
if (_settings.FreeleechOnly)
|
||||
{
|
||||
parameters.Add("freetorrent", "1");
|
||||
}
|
||||
|
||||
if (searchCriteria.MinSize is > 0)
|
||||
{
|
||||
var minSize = searchCriteria.MinSize.Value / 1024L / 1024L;
|
||||
|
|
@ -404,6 +409,15 @@ public IList<ReleaseInfo> ParseResponse(IndexerResponse indexerResponse)
|
|||
|
||||
foreach (var torrent in torrents)
|
||||
{
|
||||
Enum.TryParse(torrent.Value.FreeTorrent, true, out GazelleGamesFreeTorrent freeTorrent);
|
||||
var downloadVolumeFactor = freeTorrent is GazelleGamesFreeTorrent.FreeLeech or GazelleGamesFreeTorrent.Neutral || torrent.Value.LowSeedFL ? 0 : 1;
|
||||
|
||||
// Skip non-freeleech results when freeleech only is set
|
||||
if (_settings.FreeleechOnly && downloadVolumeFactor != 0.0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var torrentId = torrent.Key;
|
||||
var infoUrl = GetInfoUrl(group.Key, torrentId);
|
||||
|
||||
|
|
@ -412,8 +426,6 @@ public IList<ReleaseInfo> ParseResponse(IndexerResponse indexerResponse)
|
|||
categories = _categories.MapTrackerCatToNewznab(torrent.Value.CategoryId.ToString()).ToArray();
|
||||
}
|
||||
|
||||
Enum.TryParse(torrent.Value.FreeTorrent, true, out GazelleGamesFreeTorrent freeTorrent);
|
||||
|
||||
var release = new TorrentInfo
|
||||
{
|
||||
Guid = infoUrl,
|
||||
|
|
@ -428,7 +440,7 @@ public IList<ReleaseInfo> ParseResponse(IndexerResponse indexerResponse)
|
|||
Peers = torrent.Value.Leechers + torrent.Value.Seeders,
|
||||
PublishDate = torrent.Value.Time.ToUniversalTime(),
|
||||
Scene = torrent.Value.Scene == 1,
|
||||
DownloadVolumeFactor = freeTorrent is GazelleGamesFreeTorrent.FreeLeech or GazelleGamesFreeTorrent.Neutral || torrent.Value.LowSeedFL ? 0 : 1,
|
||||
DownloadVolumeFactor = downloadVolumeFactor,
|
||||
UploadVolumeFactor = freeTorrent == GazelleGamesFreeTorrent.Neutral ? 0 : 1,
|
||||
MinimumSeedTime = 288000 // Minimum of 3 days and 8 hours (80 hours in total)
|
||||
};
|
||||
|
|
@ -543,6 +555,9 @@ public GazelleGamesSettings()
|
|||
[FieldDefinition(3, Label = "IndexerGazelleGamesSettingsSearchGroupNames", Type = FieldType.Checkbox, HelpText = "IndexerGazelleGamesSettingsSearchGroupNamesHelpText")]
|
||||
public bool SearchGroupNames { get; set; }
|
||||
|
||||
[FieldDefinition(4, Label = "IndexerSettingsFreeleechOnly", HelpText = "IndexerGazelleGamesSettingsFreeleechOnlyHelpText", Type = FieldType.Checkbox, Advanced = true)]
|
||||
public bool FreeleechOnly { get; set; }
|
||||
|
||||
public string Passkey { get; set; }
|
||||
|
||||
public override NzbDroneValidationResult Validate()
|
||||
|
|
|
|||
|
|
@ -336,6 +336,7 @@
|
|||
"IndexerFlags": "Indexer Flags",
|
||||
"IndexerGazelleGamesSettingsApiKeyHelpText": "API Key from the Site (Found in Settings => Access Settings)",
|
||||
"IndexerGazelleGamesSettingsApiKeyHelpTextWarning": "Must have User and Torrents permissions",
|
||||
"IndexerGazelleGamesSettingsFreeleechOnlyHelpText": "Search freeleech releases only",
|
||||
"IndexerGazelleGamesSettingsSearchGroupNames": "Search Group Names",
|
||||
"IndexerGazelleGamesSettingsSearchGroupNamesHelpText": "Search releases by group names",
|
||||
"IndexerHDBitsSettingsCodecs": "Codecs",
|
||||
|
|
|
|||
Loading…
Reference in a new issue