Fixed: Don't worry about qBit parameters if category is blank

pull/756/head
Qstick 6 years ago
parent cfcc5b13e4
commit 77293cf8ae

@ -87,9 +87,14 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent
public List<QBittorrentTorrent> 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<List<QBittorrentTorrent>>(request, settings);
return response;

@ -86,8 +86,12 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent
public List<QBittorrentTorrent> 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<List<QBittorrentTorrent>>(request, settings);
return response;

Loading…
Cancel
Save