Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bakabt: add freeleech only option #14377

Merged
merged 1 commit into from May 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/Jackett.Common/Indexers/BakaBT.cs
Expand Up @@ -164,6 +164,14 @@ protected override async Task<IEnumerable<ReleaseInfo>> PerformQuery(TorznabQuer

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");
if (qTitleLink == null)
continue;
Expand Down Expand Up @@ -247,7 +255,7 @@ protected override async Task<IEnumerable<ReleaseInfo>> PerformQuery(TorznabQuer
else
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;

releases.Add(release);
Expand Down
Expand Up @@ -5,12 +5,14 @@ namespace Jackett.Common.Models.IndexerConfig.Bespoke
[ExcludeFromCodeCoverage]
internal class ConfigurationDataBakaBT : ConfigurationDataBasicLogin
{
public BoolConfigurationItem FreeleechOnly { get; private set; }
public BoolConfigurationItem AddRomajiTitle { get; private set; }
public BoolConfigurationItem AppendSeason { get; private set; }

public ConfigurationDataBakaBT(string instructionMessageOptional = null)
: base(instructionMessageOptional)
{
FreeleechOnly = new BoolConfigurationItem("Show freeleech only") { Value = false };
AddRomajiTitle = new BoolConfigurationItem("Add releases for Romaji Title") { Value = true };
AppendSeason = new BoolConfigurationItem("Append Season for Sonarr Compatibility") { Value = false };
}
Expand Down