Add required flag for PTP (#688)

This commit is contained in:
Devin Buhl 2017-02-10 01:35:47 -05:00 committed by GitHub
parent f477c46406
commit f45aab27d1
3 changed files with 17 additions and 8 deletions

View File

@ -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;
}

View File

@ -70,9 +70,18 @@ namespace NzbDrone.Core.Indexers.PassThePopcorn
{
Authenticate();
var request =
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('/'));

View File

@ -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()
{