mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Add required flag for PTP (#688)
This commit is contained in:
@@ -57,7 +57,7 @@ namespace NzbDrone.Core.Indexers.PassThePopcorn
|
||||
}
|
||||
|
||||
// Only add approved torrents
|
||||
if (_settings.Approved && torrent.Checked)
|
||||
if (_settings.RequireApproved && torrent.Checked)
|
||||
{
|
||||
torrentInfos.Add(new PassThePopcornInfo()
|
||||
{
|
||||
@@ -75,7 +75,7 @@ namespace NzbDrone.Core.Indexers.PassThePopcorn
|
||||
});
|
||||
}
|
||||
// Add all torrents
|
||||
else if (!_settings.Approved)
|
||||
else if (!_settings.RequireApproved)
|
||||
{
|
||||
torrentInfos.Add(new PassThePopcornInfo()
|
||||
{
|
||||
@@ -93,7 +93,7 @@ namespace NzbDrone.Core.Indexers.PassThePopcorn
|
||||
});
|
||||
}
|
||||
// Don't add any torrents
|
||||
else if (_settings.Approved && !torrent.Checked)
|
||||
else if (_settings.RequireApproved && !torrent.Checked)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@@ -70,9 +70,18 @@ namespace NzbDrone.Core.Indexers.PassThePopcorn
|
||||
{
|
||||
Authenticate();
|
||||
|
||||
var filter = "";
|
||||
if (searchParameters == null)
|
||||
{
|
||||
if (Settings.RequireGolden)
|
||||
{
|
||||
filter = "&scene=2";
|
||||
}
|
||||
}
|
||||
|
||||
var request =
|
||||
new IndexerRequest(
|
||||
$"{Settings.BaseUrl.Trim().TrimEnd('/')}/torrents.php?json=noredirect&searchstr={searchParameters}",
|
||||
$"{Settings.BaseUrl.Trim().TrimEnd('/')}/torrents.php??action=advanced&json=noredirect&searchstr={searchParameters}{filter}",
|
||||
HttpAccept.Json);
|
||||
|
||||
var cookies = AuthCookieCache.Find(Settings.BaseUrl.Trim().TrimEnd('/'));
|
||||
|
@@ -45,10 +45,10 @@ namespace NzbDrone.Core.Indexers.PassThePopcorn
|
||||
public bool Scene { get; set; }
|
||||
|
||||
[FieldDefinition(6, Label = "Require Approved", Type = FieldType.Checkbox, HelpText = "Require staff-approval for releases to be accepted.")]
|
||||
public bool Approved { get; set; }
|
||||
public bool RequireApproved { get; set; }
|
||||
|
||||
//[FieldDefinition(7, Label = "Require Golden", Type = FieldType.Checkbox, HelpText = "Require Golden Popcorn-releases for releases to be accepted.")]
|
||||
//public bool RequireGolden { get; set; }
|
||||
[FieldDefinition(7, Label = "Require Golden", Type = FieldType.Checkbox, HelpText = "Require Golden Popcorn-releases for releases to be accepted.")]
|
||||
public bool RequireGolden { get; set; }
|
||||
|
||||
public NzbDroneValidationResult Validate()
|
||||
{
|
||||
|
Reference in New Issue
Block a user