Browse Source

qBittorrent: Fix working with no categories

pull/643/head
Brian Witt 2 years ago
parent
commit
d605ceb971
  1. 6
      app/src/main/java/org/transdroid/daemon/adapters/qBittorrent/QBittorrentAdapter.java

6
app/src/main/java/org/transdroid/daemon/adapters/qBittorrent/QBittorrentAdapter.java

@ -237,10 +237,12 @@ public class QBittorrentAdapter implements IDaemonAdapter { @@ -237,10 +237,12 @@ public class QBittorrentAdapter implements IDaemonAdapter {
JSONArray allTorrentsResult = new JSONArray(makeRequest(log, path));
final List<Torrent> torrentsList = parseJsonTorrents(allTorrentsResult);
JSONArray allLabelsResult;
JSONArray allLabelsResult = null;
if (version >= 40100) {
allLabelsResult = new JSONObject(makeRequest(log, "/api/v2/torrents/categories")).names();
} else {
}
// either version < 40100 or no labels
if (allLabelsResult == null) {
allLabelsResult = new JSONArray();
}
final List<Label> labelList = parseJsonLabels(allLabelsResult, allTorrentsResult);

Loading…
Cancel
Save