mirror of
https://github.com/Sonarr/Sonarr
synced 2026-05-08 13:01:10 +02:00
Don't throw error on pushed releases with empty indexer or download client IDs
This commit is contained in:
parent
04d98098e0
commit
6214803a5a
2 changed files with 5 additions and 5 deletions
|
|
@ -60,9 +60,9 @@ public DownloadClientDefinition ResolveDownloadClient(int? id, string name)
|
|||
{
|
||||
var all = All();
|
||||
var clientByName = name.IsNullOrWhiteSpace() ? null : all.FirstOrDefault(c => c.Name.EqualsIgnoreCase(name));
|
||||
var clientById = id.HasValue ? all.FirstOrDefault(c => c.Id == id.Value) : null;
|
||||
var clientById = id is > 0 ? all.FirstOrDefault(c => c.Id == id.Value) : null;
|
||||
|
||||
if (id.HasValue && clientById == null)
|
||||
if (id is > 0 && clientById == null)
|
||||
{
|
||||
throw new ResolveDownloadClientException("Download client with ID '{0}' could not be found", id.Value);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,9 +96,9 @@ public IndexerDefinition ResolveIndexer(int? id, string name)
|
|||
{
|
||||
var all = All();
|
||||
var clientByName = name.IsNullOrWhiteSpace() ? null : all.FirstOrDefault(c => c.Name.EqualsIgnoreCase(name));
|
||||
var clientById = id.HasValue ? all.FirstOrDefault(c => c.Id == id.Value) : null;
|
||||
var clientById = id is > 0 ? all.FirstOrDefault(c => c.Id == id.Value) : null;
|
||||
|
||||
if (id.HasValue && clientById == null)
|
||||
if (id is > 0 && clientById == null)
|
||||
{
|
||||
throw new ResolveIndexerException("Indexer with ID '{0}' could not be found", id.Value);
|
||||
}
|
||||
|
|
@ -115,7 +115,7 @@ public IndexerDefinition ResolveIndexer(int? id, string name)
|
|||
|
||||
if (clientByName != null && clientById != null && clientByName.Id != clientById.Id)
|
||||
{
|
||||
throw new ResolveIndexerException("Indexer with name '{0}' does not match Indexerwith ID '{1}'", name, id.Value);
|
||||
throw new ResolveIndexerException("Indexer with name '{0}' does not match indexer with ID '{1}'", name, id.Value);
|
||||
}
|
||||
|
||||
return clientById ?? clientByName;
|
||||
|
|
|
|||
Loading…
Reference in a new issue