Fixed: Include all download items if no category is specified in rtorrent.

closes #3002
This commit is contained in:
Taloth Saldono 2019-03-24 15:27:41 +01:00
parent eb2e7b9c79
commit 1fc2866032
3 changed files with 13 additions and 7 deletions

View File

@ -87,9 +87,12 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent
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.TvCategory) if (settings.TvCategory.IsNotNullOrWhiteSpace())
.AddQueryParam("category", settings.TvCategory); {
request.AddQueryParam("label", settings.TvCategory);
request.AddQueryParam("category", settings.TvCategory);
}
var response = ProcessRequest<List<QBittorrentTorrent>>(request, settings); var response = ProcessRequest<List<QBittorrentTorrent>>(request, settings);
return response; return response;

View File

@ -86,8 +86,11 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent
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.TvCategory); if (settings.TvCategory.IsNotNullOrWhiteSpace())
{
request.AddQueryParam("category", settings.TvCategory);
}
var response = ProcessRequest<List<QBittorrentTorrent>>(request, settings); var response = ProcessRequest<List<QBittorrentTorrent>>(request, settings);
return response; return response;

View File

@ -89,11 +89,11 @@ namespace NzbDrone.Core.Download.Clients.RTorrent
foreach (RTorrentTorrent torrent in torrents) foreach (RTorrentTorrent torrent in torrents)
{ {
// Don't concern ourselves with categories other than specified // Don't concern ourselves with categories other than specified
if (torrent.Category != Settings.TvCategory) continue; if (Settings.TvCategory.IsNotNullOrWhiteSpace() && torrent.Category != Settings.TvCategory) continue;
if (torrent.Path.StartsWith(".")) if (torrent.Path.StartsWith("."))
{ {
throw new DownloadClientException("Download paths paths must be absolute. Please specify variable \"directory\" in rTorrent."); throw new DownloadClientException("Download paths must be absolute. Please specify variable \"directory\" in rTorrent.");
} }
var item = new DownloadClientItem(); var item = new DownloadClientItem();