|
|
@ -193,11 +193,17 @@ public class QbittorrentAdapter implements IDaemonAdapter { |
|
|
|
|
|
|
|
|
|
|
|
switch (task.getMethod()) { |
|
|
|
switch (task.getMethod()) { |
|
|
|
case Retrieve: |
|
|
|
case Retrieve: |
|
|
|
|
|
|
|
String path; |
|
|
|
|
|
|
|
if (version >= 30200) { |
|
|
|
|
|
|
|
path = "/query/torrents"; |
|
|
|
|
|
|
|
} else if (version >= 30000) { |
|
|
|
|
|
|
|
path = "/json/torrents"; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
path = "/json/events"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Request all torrents from server
|
|
|
|
// Request all torrents from server
|
|
|
|
JSONArray result = new JSONArray(makeRequest(log, |
|
|
|
JSONArray result = new JSONArray(makeRequest(log, path)); |
|
|
|
version >= 30200 ? "/query/torrents" : |
|
|
|
|
|
|
|
version >= 30000 ? "/json/torrents" : "/json/events")); |
|
|
|
|
|
|
|
return new RetrieveTaskSuccessResult((RetrieveTask) task, parseJsonTorrents(result), null); |
|
|
|
return new RetrieveTaskSuccessResult((RetrieveTask) task, parseJsonTorrents(result), null); |
|
|
|
|
|
|
|
|
|
|
|
case GetTorrentDetails: |
|
|
|
case GetTorrentDetails: |
|
|
|