File tree Expand file tree Collapse file tree 3 files changed +13
-7
lines changed
src/NzbDrone.Core/Download/Clients Expand file tree Collapse file tree 3 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -87,9 +87,12 @@ public QBittorrentPreferences GetConfig(QBittorrentSettings settings)
8787
8888 public List < QBittorrentTorrent > GetTorrents ( QBittorrentSettings settings )
8989 {
90- var request = BuildRequest ( settings ) . Resource ( "/query/torrents" )
91- . AddQueryParam ( "label" , settings . TvCategory )
92- . AddQueryParam ( "category" , settings . TvCategory ) ;
90+ var request = BuildRequest ( settings ) . Resource ( "/query/torrents" ) ;
91+ if ( settings . TvCategory . IsNotNullOrWhiteSpace ( ) )
92+ {
93+ request . AddQueryParam ( "label" , settings . TvCategory ) ;
94+ request . AddQueryParam ( "category" , settings . TvCategory ) ;
95+ }
9396 var response = ProcessRequest < List < QBittorrentTorrent > > ( request , settings ) ;
9497
9598 return response ;
Original file line number Diff line number Diff line change @@ -86,8 +86,11 @@ public QBittorrentPreferences GetConfig(QBittorrentSettings settings)
8686
8787 public List < QBittorrentTorrent > GetTorrents ( QBittorrentSettings settings )
8888 {
89- var request = BuildRequest ( settings ) . Resource ( "/api/v2/torrents/info" )
90- . AddQueryParam ( "category" , settings . TvCategory ) ;
89+ var request = BuildRequest ( settings ) . Resource ( "/api/v2/torrents/info" ) ;
90+ if ( settings . TvCategory . IsNotNullOrWhiteSpace ( ) )
91+ {
92+ request . AddQueryParam ( "category" , settings . TvCategory ) ;
93+ }
9194 var response = ProcessRequest < List < QBittorrentTorrent > > ( request , settings ) ;
9295
9396 return response ;
Original file line number Diff line number Diff line change @@ -89,11 +89,11 @@ public override IEnumerable<DownloadClientItem> GetItems()
8989 foreach ( RTorrentTorrent torrent in torrents )
9090 {
9191 // Don't concern ourselves with categories other than specified
92- if ( torrent . Category != Settings . TvCategory ) continue ;
92+ if ( Settings . TvCategory . IsNotNullOrWhiteSpace ( ) && torrent . Category != Settings . TvCategory ) continue ;
9393
9494 if ( torrent . Path . StartsWith ( "." ) )
9595 {
96- throw new DownloadClientException ( "Download paths paths must be absolute. Please specify variable \" directory\" in rTorrent." ) ;
96+ throw new DownloadClientException ( "Download paths must be absolute. Please specify variable \" directory\" in rTorrent." ) ;
9797 }
9898
9999 var item = new DownloadClientItem ( ) ;
You can’t perform that action at this time.
0 commit comments