From 84e657482d37eed35f09c6dab3c2b8b5ebd5bac4 Mon Sep 17 00:00:00 2001 From: Bogdan Date: Wed, 7 Feb 2024 09:46:10 +0200 Subject: [PATCH] Improve messaging on indexer specified download client is not available --- src/NzbDrone.Core/Download/DownloadClientProvider.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/NzbDrone.Core/Download/DownloadClientProvider.cs b/src/NzbDrone.Core/Download/DownloadClientProvider.cs index 8e8bcf8be..769928f2f 100644 --- a/src/NzbDrone.Core/Download/DownloadClientProvider.cs +++ b/src/NzbDrone.Core/Download/DownloadClientProvider.cs @@ -59,13 +59,18 @@ namespace NzbDrone.Core.Download { var indexer = _indexerFactory.Find(indexerId); - if (indexer != null && indexer.DownloadClientId > 0) + if (indexer is { DownloadClientId: > 0 }) { var client = availableProviders.SingleOrDefault(d => d.Definition.Id == indexer.DownloadClientId); - if (client == null || (filterBlockedClients && blockedProviders.Contains(client.Definition.Id))) + if (client == null) { - throw new DownloadClientUnavailableException($"Indexer specified download client is not available"); + throw new DownloadClientUnavailableException($"Indexer specified download client does not exist for {indexer.Name}"); + } + + if (filterBlockedClients && blockedProviders.Contains(client.Definition.Id)) + { + throw new DownloadClientUnavailableException($"Indexer specified download client is not available due to recent failures for {indexer.Name}"); } return client;