Browse Source

Merge pull request #643 from bwitt/fix-qb-no-categories

qBittorrent: Fix working with no categories
pull/651/head
Eric Kok 2 years ago committed by GitHub
parent
commit
b3532a4b7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  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