From c017a3cd7eaefac38ff56c4174904d2dc1f3e830 Mon Sep 17 00:00:00 2001 From: Bogdan Date: Sun, 29 Sep 2024 12:12:26 +0300 Subject: [PATCH] New: (PTP) Filter by Golden Popcorn only releases --- .../Indexers/Definitions/PassThePopcorn/PassThePopcorn.cs | 2 +- .../PassThePopcorn/PassThePopcornRequestGenerator.cs | 5 +++++ .../Definitions/PassThePopcorn/PassThePopcornSettings.cs | 3 +++ src/NzbDrone.Core/Localization/Core/en.json | 2 ++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/NzbDrone.Core/Indexers/Definitions/PassThePopcorn/PassThePopcorn.cs b/src/NzbDrone.Core/Indexers/Definitions/PassThePopcorn/PassThePopcorn.cs index 9cb147b48..177c4f1b2 100644 --- a/src/NzbDrone.Core/Indexers/Definitions/PassThePopcorn/PassThePopcorn.cs +++ b/src/NzbDrone.Core/Indexers/Definitions/PassThePopcorn/PassThePopcorn.cs @@ -73,6 +73,6 @@ namespace NzbDrone.Core.Indexers.Definitions.PassThePopcorn public class PassThePopcornFlag : IndexerFlag { public static IndexerFlag Golden => new ("golden", "Release follows Golden Popcorn quality rules"); - public static IndexerFlag Approved => new ("approved", "Release approved by PTP"); + public static IndexerFlag Approved => new ("approved", "Release approved by PTP staff"); } } diff --git a/src/NzbDrone.Core/Indexers/Definitions/PassThePopcorn/PassThePopcornRequestGenerator.cs b/src/NzbDrone.Core/Indexers/Definitions/PassThePopcorn/PassThePopcornRequestGenerator.cs index 17d9b1813..90b370e7b 100644 --- a/src/NzbDrone.Core/Indexers/Definitions/PassThePopcorn/PassThePopcornRequestGenerator.cs +++ b/src/NzbDrone.Core/Indexers/Definitions/PassThePopcorn/PassThePopcornRequestGenerator.cs @@ -86,6 +86,11 @@ namespace NzbDrone.Core.Indexers.Definitions.PassThePopcorn parameters.Set("freetorrent", "1"); } + if (_settings.GoldenPopcornOnly) + { + parameters.Set("scene", "2"); + } + var queryCats = _capabilities.Categories .MapTorznabCapsToTrackers(searchCriteria.Categories) .Select(int.Parse) diff --git a/src/NzbDrone.Core/Indexers/Definitions/PassThePopcorn/PassThePopcornSettings.cs b/src/NzbDrone.Core/Indexers/Definitions/PassThePopcorn/PassThePopcornSettings.cs index 08ae2284c..5494ff989 100644 --- a/src/NzbDrone.Core/Indexers/Definitions/PassThePopcorn/PassThePopcornSettings.cs +++ b/src/NzbDrone.Core/Indexers/Definitions/PassThePopcorn/PassThePopcornSettings.cs @@ -27,6 +27,9 @@ namespace NzbDrone.Core.Indexers.Definitions.PassThePopcorn [FieldDefinition(4, Label = "IndexerSettingsFreeleechOnly", HelpText = "IndexerPassThePopcornSettingsFreeleechOnlyHelpText", Type = FieldType.Checkbox)] public bool FreeleechOnly { get; set; } + [FieldDefinition(5, Label = "IndexerPassThePopcornSettingsGoldenPopcornOnly", HelpText = "IndexerPassThePopcornSettingsGoldenPopcornOnlyHelpText", Type = FieldType.Checkbox, Advanced = true)] + public bool GoldenPopcornOnly { get; set; } + public override NzbDroneValidationResult Validate() { return new NzbDroneValidationResult(Validator.Validate(this)); diff --git a/src/NzbDrone.Core/Localization/Core/en.json b/src/NzbDrone.Core/Localization/Core/en.json index 97da2ffae..9b0ac1be8 100644 --- a/src/NzbDrone.Core/Localization/Core/en.json +++ b/src/NzbDrone.Core/Localization/Core/en.json @@ -380,6 +380,8 @@ "IndexerPassThePopcornSettingsApiKeyHelpText": "Site API Key", "IndexerPassThePopcornSettingsApiUserHelpText": "These settings are found in your PassThePopcorn security settings (Edit Profile > Security).", "IndexerPassThePopcornSettingsFreeleechOnlyHelpText": "Search freeleech releases only", + "IndexerPassThePopcornSettingsGoldenPopcornOnly": "Golden Popcorn only", + "IndexerPassThePopcornSettingsGoldenPopcornOnlyHelpText": "Search Golden Popcorn releases only", "IndexerPriority": "Indexer Priority", "IndexerPriorityHelpText": "Indexer Priority from 1 (Highest) to 50 (Lowest). Default: 25.", "IndexerProxies": "Indexer Proxies",