1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2025-02-25 15:43:08 +00:00

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 @@ public IList<ReleaseInfo> ParseResponse(IndexerResponse indexerResponse)
} }
// 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 @@ public IList<ReleaseInfo> ParseResponse(IndexerResponse indexerResponse)
}); });
} }
// 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 @@ public IList<ReleaseInfo> ParseResponse(IndexerResponse indexerResponse)
}); });
} }
// Don't add any torrents // Don't add any torrents
else if (_settings.Approved && !torrent.Checked) else if (_settings.RequireApproved && !torrent.Checked)
{ {
continue; continue;
} }

View file

@ -70,9 +70,18 @@ private IEnumerable<IndexerRequest> GetRequest(string searchParameters)
{ {
Authenticate(); Authenticate();
var request = var filter = "";
if (searchParameters == null)
{
if (Settings.RequireGolden)
{
filter = "&scene=2";
}
}
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('/'));

View file

@ -45,10 +45,10 @@ public PassThePopcornSettings()
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()
{ {