mirror of
https://github.com/Radarr/Radarr
synced 2025-02-25 07:32:56 +00:00
Add required flag for PTP (#688)
This commit is contained in:
parent
f477c46406
commit
f45aab27d1
3 changed files with 17 additions and 8 deletions
|
@ -57,7 +57,7 @@ public IList<ReleaseInfo> ParseResponse(IndexerResponse indexerResponse)
|
|||
}
|
||||
|
||||
// Only add approved torrents
|
||||
if (_settings.Approved && torrent.Checked)
|
||||
if (_settings.RequireApproved && torrent.Checked)
|
||||
{
|
||||
torrentInfos.Add(new PassThePopcornInfo()
|
||||
{
|
||||
|
@ -75,7 +75,7 @@ public IList<ReleaseInfo> ParseResponse(IndexerResponse indexerResponse)
|
|||
});
|
||||
}
|
||||
// Add all torrents
|
||||
else if (!_settings.Approved)
|
||||
else if (!_settings.RequireApproved)
|
||||
{
|
||||
torrentInfos.Add(new PassThePopcornInfo()
|
||||
{
|
||||
|
@ -93,7 +93,7 @@ public IList<ReleaseInfo> ParseResponse(IndexerResponse indexerResponse)
|
|||
});
|
||||
}
|
||||
// Don't add any torrents
|
||||
else if (_settings.Approved && !torrent.Checked)
|
||||
else if (_settings.RequireApproved && !torrent.Checked)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -70,9 +70,18 @@ private IEnumerable<IndexerRequest> GetRequest(string searchParameters)
|
|||
{
|
||||
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('/'));
|
||||
|
|
|
@ -45,10 +45,10 @@ public PassThePopcornSettings()
|
|||
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()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue