mirror of
https://github.com/lidarr/Lidarr
synced 2025-02-27 00:02:25 +00:00
Fixed: Don't worry about qBit parameters if category is blank
This commit is contained in:
parent
cfcc5b13e4
commit
77293cf8ae
2 changed files with 14 additions and 5 deletions
|
@ -87,9 +87,14 @@ public QBittorrentPreferences GetConfig(QBittorrentSettings settings)
|
||||||
|
|
||||||
public List<QBittorrentTorrent> GetTorrents(QBittorrentSettings settings)
|
public List<QBittorrentTorrent> GetTorrents(QBittorrentSettings settings)
|
||||||
{
|
{
|
||||||
var request = BuildRequest(settings).Resource("/query/torrents")
|
var request = BuildRequest(settings).Resource("/query/torrents");
|
||||||
.AddQueryParam("label", settings.MusicCategory)
|
|
||||||
.AddQueryParam("category", settings.MusicCategory);
|
if (settings.MusicCategory.IsNotNullOrWhiteSpace())
|
||||||
|
{
|
||||||
|
request.AddQueryParam("label", settings.MusicCategory);
|
||||||
|
request.AddQueryParam("category", settings.MusicCategory);
|
||||||
|
}
|
||||||
|
|
||||||
var response = ProcessRequest<List<QBittorrentTorrent>>(request, settings);
|
var response = ProcessRequest<List<QBittorrentTorrent>>(request, settings);
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
|
|
|
@ -86,8 +86,12 @@ public QBittorrentPreferences GetConfig(QBittorrentSettings settings)
|
||||||
|
|
||||||
public List<QBittorrentTorrent> GetTorrents(QBittorrentSettings settings)
|
public List<QBittorrentTorrent> GetTorrents(QBittorrentSettings settings)
|
||||||
{
|
{
|
||||||
var request = BuildRequest(settings).Resource("/api/v2/torrents/info")
|
var request = BuildRequest(settings).Resource("/api/v2/torrents/info");
|
||||||
.AddQueryParam("category", settings.MusicCategory);
|
if (settings.MusicCategory.IsNotNullOrWhiteSpace())
|
||||||
|
{
|
||||||
|
request.AddQueryParam("category", settings.MusicCategory);
|
||||||
|
}
|
||||||
|
|
||||||
var response = ProcessRequest<List<QBittorrentTorrent>>(request, settings);
|
var response = ProcessRequest<List<QBittorrentTorrent>>(request, settings);
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
|
|
Loading…
Reference in a new issue