From 77293cf8aeaf87a7c0e4704f6169dc0c5a2cfad7 Mon Sep 17 00:00:00 2001 From: Qstick Date: Sat, 13 Apr 2019 22:55:30 -0400 Subject: [PATCH] Fixed: Don't worry about qBit parameters if category is blank --- .../Clients/QBittorrent/QBittorrentProxyV1.cs | 11 ++++++++--- .../Clients/QBittorrent/QBittorrentProxyV2.cs | 8 ++++++-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrentProxyV1.cs b/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrentProxyV1.cs index 13e22a713..d9077a9c2 100644 --- a/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrentProxyV1.cs +++ b/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrentProxyV1.cs @@ -87,9 +87,14 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent public List GetTorrents(QBittorrentSettings settings) { - var request = BuildRequest(settings).Resource("/query/torrents") - .AddQueryParam("label", settings.MusicCategory) - .AddQueryParam("category", settings.MusicCategory); + var request = BuildRequest(settings).Resource("/query/torrents"); + + if (settings.MusicCategory.IsNotNullOrWhiteSpace()) + { + request.AddQueryParam("label", settings.MusicCategory); + request.AddQueryParam("category", settings.MusicCategory); + } + var response = ProcessRequest>(request, settings); return response; diff --git a/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrentProxyV2.cs b/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrentProxyV2.cs index 6eecc9c7a..d223f92e3 100644 --- a/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrentProxyV2.cs +++ b/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrentProxyV2.cs @@ -86,8 +86,12 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent public List GetTorrents(QBittorrentSettings settings) { - var request = BuildRequest(settings).Resource("/api/v2/torrents/info") - .AddQueryParam("category", settings.MusicCategory); + var request = BuildRequest(settings).Resource("/api/v2/torrents/info"); + if (settings.MusicCategory.IsNotNullOrWhiteSpace()) + { + request.AddQueryParam("category", settings.MusicCategory); + } + var response = ProcessRequest>(request, settings); return response;