mirror of
https://github.com/Jackett/Jackett
synced 2025-03-05 03:08:50 +00:00
bakabt: add freeleech only option (#14377)
This commit is contained in:
parent
97873506e3
commit
2594fdba13
2 changed files with 11 additions and 1 deletions
|
@ -164,6 +164,14 @@ namespace Jackett.Common.Indexers
|
||||||
|
|
||||||
foreach (var row in rows)
|
foreach (var row in rows)
|
||||||
{
|
{
|
||||||
|
var downloadVolumeFactor = row.QuerySelector("span.freeleech") != null ? 0 : 1;
|
||||||
|
|
||||||
|
// Skip non-freeleech results when freeleech only is set
|
||||||
|
if (configData.FreeleechOnly.Value && downloadVolumeFactor != 0)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
var qTitleLink = row.QuerySelector("a.title, a.alt_title");
|
var qTitleLink = row.QuerySelector("a.title, a.alt_title");
|
||||||
if (qTitleLink == null)
|
if (qTitleLink == null)
|
||||||
continue;
|
continue;
|
||||||
|
@ -247,7 +255,7 @@ namespace Jackett.Common.Indexers
|
||||||
else
|
else
|
||||||
release.PublishDate = DateTime.ParseExact(dateStr, "dd MMM yy", CultureInfo.InvariantCulture);
|
release.PublishDate = DateTime.ParseExact(dateStr, "dd MMM yy", CultureInfo.InvariantCulture);
|
||||||
|
|
||||||
release.DownloadVolumeFactor = row.QuerySelector("span.freeleech") != null ? 0 : 1;
|
release.DownloadVolumeFactor = downloadVolumeFactor;
|
||||||
release.UploadVolumeFactor = 1;
|
release.UploadVolumeFactor = 1;
|
||||||
|
|
||||||
releases.Add(release);
|
releases.Add(release);
|
||||||
|
|
|
@ -5,12 +5,14 @@ namespace Jackett.Common.Models.IndexerConfig.Bespoke
|
||||||
[ExcludeFromCodeCoverage]
|
[ExcludeFromCodeCoverage]
|
||||||
internal class ConfigurationDataBakaBT : ConfigurationDataBasicLogin
|
internal class ConfigurationDataBakaBT : ConfigurationDataBasicLogin
|
||||||
{
|
{
|
||||||
|
public BoolConfigurationItem FreeleechOnly { get; private set; }
|
||||||
public BoolConfigurationItem AddRomajiTitle { get; private set; }
|
public BoolConfigurationItem AddRomajiTitle { get; private set; }
|
||||||
public BoolConfigurationItem AppendSeason { get; private set; }
|
public BoolConfigurationItem AppendSeason { get; private set; }
|
||||||
|
|
||||||
public ConfigurationDataBakaBT(string instructionMessageOptional = null)
|
public ConfigurationDataBakaBT(string instructionMessageOptional = null)
|
||||||
: base(instructionMessageOptional)
|
: base(instructionMessageOptional)
|
||||||
{
|
{
|
||||||
|
FreeleechOnly = new BoolConfigurationItem("Show freeleech only") { Value = false };
|
||||||
AddRomajiTitle = new BoolConfigurationItem("Add releases for Romaji Title") { Value = true };
|
AddRomajiTitle = new BoolConfigurationItem("Add releases for Romaji Title") { Value = true };
|
||||||
AppendSeason = new BoolConfigurationItem("Append Season for Sonarr Compatibility") { Value = false };
|
AppendSeason = new BoolConfigurationItem("Append Season for Sonarr Compatibility") { Value = false };
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue