From a2b0f199f15d12018047190d689349f15187b5e7 Mon Sep 17 00:00:00 2001 From: Tiago Santos Date: Sat, 28 Sep 2024 15:55:43 +0100 Subject: [PATCH] Fixed: (BeyondHD) Filter freeleech or limited releases when configured --- src/NzbDrone.Core/Indexers/Definitions/BeyondHD.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/NzbDrone.Core/Indexers/Definitions/BeyondHD.cs b/src/NzbDrone.Core/Indexers/Definitions/BeyondHD.cs index a8826c259..45c8344e5 100644 --- a/src/NzbDrone.Core/Indexers/Definitions/BeyondHD.cs +++ b/src/NzbDrone.Core/Indexers/Definitions/BeyondHD.cs @@ -45,7 +45,7 @@ namespace NzbDrone.Core.Indexers.Definitions public override IParseIndexerResponse GetParser() { - return new BeyondHDParser(Capabilities.Categories); + return new BeyondHDParser(Settings, Capabilities.Categories); } protected override IList CleanupReleases(IEnumerable releases, SearchCriteriaBase searchCriteria) @@ -227,10 +227,12 @@ namespace NzbDrone.Core.Indexers.Definitions public class BeyondHDParser : IParseIndexerResponse { + private readonly BeyondHDSettings _settings; private readonly IndexerCapabilitiesCategories _categories; - public BeyondHDParser(IndexerCapabilitiesCategories categories) + public BeyondHDParser(BeyondHDSettings settings, IndexerCapabilitiesCategories categories) { + _settings = settings; _categories = categories; } @@ -264,6 +266,12 @@ namespace NzbDrone.Core.Indexers.Definitions foreach (var row in jsonResponse.Results) { + // Skip invalid results when freeleech or limited filtering is set + if ((_settings.FreeleechOnly && !row.Freeleech) || (_settings.LimitedOnly && !row.Limited)) + { + continue; + } + var details = row.InfoUrl; var link = row.DownloadLink;