mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-04 10:02:40 +01:00
Minor CS improvements in NzbDroneValidation
(cherry picked from commit 6118afa339621509aad55caf27b05e89bd0b8c74)
This commit is contained in:
parent
d5605abd91
commit
aa794bddab
@ -26,8 +26,7 @@ public static bool HasErrors(this List<ValidationFailure> list)
|
|||||||
{
|
{
|
||||||
foreach (var item in list)
|
foreach (var item in list)
|
||||||
{
|
{
|
||||||
var extended = item as NzbDroneValidationFailure;
|
if (item is NzbDroneValidationFailure { IsWarning: true })
|
||||||
if (extended != null && extended.IsWarning)
|
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ public NzbDroneValidationFailure(ValidationFailure validationFailure)
|
|||||||
CustomState = validationFailure.CustomState;
|
CustomState = validationFailure.CustomState;
|
||||||
var state = validationFailure.CustomState as NzbDroneValidationState;
|
var state = validationFailure.CustomState as NzbDroneValidationState;
|
||||||
|
|
||||||
IsWarning = state != null && state.IsWarning;
|
IsWarning = state is { IsWarning: true };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,8 +26,7 @@ public NzbDroneValidationResult(IEnumerable<ValidationFailure> failures)
|
|||||||
|
|
||||||
foreach (var failureBase in failures)
|
foreach (var failureBase in failures)
|
||||||
{
|
{
|
||||||
var failure = failureBase as NzbDroneValidationFailure;
|
if (failureBase is not NzbDroneValidationFailure failure)
|
||||||
if (failure == null)
|
|
||||||
{
|
{
|
||||||
failure = new NzbDroneValidationFailure(failureBase);
|
failure = new NzbDroneValidationFailure(failureBase);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user