Add required flag for PTP (#688)

Devin Buhl 8 years ago committed by GitHub
parent f477c46406
commit f45aab27d1

@ -57,7 +57,7 @@ namespace NzbDrone.Core.Indexers.PassThePopcorn
} }
// Only add approved torrents // Only add approved torrents
if (_settings.Approved && torrent.Checked) if (_settings.RequireApproved && torrent.Checked)
{ {
torrentInfos.Add(new PassThePopcornInfo() torrentInfos.Add(new PassThePopcornInfo()
{ {
@ -75,7 +75,7 @@ namespace NzbDrone.Core.Indexers.PassThePopcorn
}); });
} }
// Add all torrents // Add all torrents
else if (!_settings.Approved) else if (!_settings.RequireApproved)
{ {
torrentInfos.Add(new PassThePopcornInfo() torrentInfos.Add(new PassThePopcornInfo()
{ {
@ -93,7 +93,7 @@ namespace NzbDrone.Core.Indexers.PassThePopcorn
}); });
} }
// Don't add any torrents // Don't add any torrents
else if (_settings.Approved && !torrent.Checked) else if (_settings.RequireApproved && !torrent.Checked)
{ {
continue; continue;
} }

@ -70,9 +70,18 @@ namespace NzbDrone.Core.Indexers.PassThePopcorn
{ {
Authenticate(); Authenticate();
var filter = "";
if (searchParameters == null)
{
if (Settings.RequireGolden)
{
filter = "&scene=2";
}
}
var request = var request =
new IndexerRequest( 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); HttpAccept.Json);
var cookies = AuthCookieCache.Find(Settings.BaseUrl.Trim().TrimEnd('/')); var cookies = AuthCookieCache.Find(Settings.BaseUrl.Trim().TrimEnd('/'));

@ -45,10 +45,10 @@ namespace NzbDrone.Core.Indexers.PassThePopcorn
public bool Scene { get; set; } public bool Scene { get; set; }
[FieldDefinition(6, Label = "Require Approved", Type = FieldType.Checkbox, HelpText = "Require staff-approval for releases to be accepted.")] [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.")] [FieldDefinition(7, Label = "Require Golden", Type = FieldType.Checkbox, HelpText = "Require Golden Popcorn-releases for releases to be accepted.")]
//public bool RequireGolden { get; set; } public bool RequireGolden { get; set; }
public NzbDroneValidationResult Validate() public NzbDroneValidationResult Validate()
{ {

Loading…
Cancel
Save