From 6d2d49f7bd1c3a30a4b5b1e192ab323426b819bc Mon Sep 17 00:00:00 2001 From: bakerboy448 <55419169+bakerboy448@users.noreply.github.com> Date: Wed, 22 Jan 2025 18:36:03 -0600 Subject: [PATCH] Fixed: (PTP) Filtering non-freeleech releases when using Freeleech Only Co-authored-by: Bogdan --- .../PassThePopcorn/PassThePopcornParser.cs | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/NzbDrone.Core/Indexers/Definitions/PassThePopcorn/PassThePopcornParser.cs b/src/NzbDrone.Core/Indexers/Definitions/PassThePopcorn/PassThePopcornParser.cs index 997ba97e0..e08536162 100644 --- a/src/NzbDrone.Core/Indexers/Definitions/PassThePopcorn/PassThePopcornParser.cs +++ b/src/NzbDrone.Core/Indexers/Definitions/PassThePopcorn/PassThePopcornParser.cs @@ -56,6 +56,19 @@ namespace NzbDrone.Core.Indexers.Definitions.PassThePopcorn { foreach (var torrent in result.Torrents) { + // skip non-freeleech results when freeleech only is set + var downloadVolumeFactor = torrent.FreeleechType?.ToUpperInvariant() switch + { + "FREELEECH" => 0, + "HALF LEECH" => 0.5, + _ => 1 + }; + + if (_settings.FreeleechOnly && downloadVolumeFactor != 0.0) + { + continue; + } + var id = torrent.Id; var title = torrent.ReleaseName; @@ -94,12 +107,7 @@ namespace NzbDrone.Core.Indexers.Definitions.PassThePopcorn ImdbId = result.ImdbId.IsNotNullOrWhiteSpace() ? int.Parse(result.ImdbId) : 0, Scene = torrent.Scene, IndexerFlags = flags, - DownloadVolumeFactor = torrent.FreeleechType?.ToUpperInvariant() switch - { - "FREELEECH" => 0, - "HALF LEECH" => 0.5, - _ => 1 - }, + DownloadVolumeFactor = downloadVolumeFactor, UploadVolumeFactor = 1, MinimumRatio = 1, MinimumSeedTime = 345600,