@ -73,7 +73,6 @@ public class QbittorrentAdapter implements IDaemonAdapter {
@@ -73,7 +73,6 @@ public class QbittorrentAdapter implements IDaemonAdapter {
privateDefaultHttpClienthttpclient;
privateintversion=-1;
privatefloatapiVersion=-1;// starting from 2.3 old API is dropped so we are going to use float
privateinthttp_response_code=-1;
publicQbittorrentAdapter(DaemonSettingssettings){
this.settings=settings;
@ -95,30 +94,36 @@ public class QbittorrentAdapter implements IDaemonAdapter {
@@ -95,30 +94,36 @@ public class QbittorrentAdapter implements IDaemonAdapter {
apiVersion=(float)2.3;// assume this is new API since we are forbidden to access API
}
}else{
// Fall back to old api
try{
StringapiVerText=makeRequest(log,"/version/api");
apiVersion=Float.parseFloat(apiVerText.trim());
}catch(DaemonException|NumberFormatExceptione){
apiVersion=1;
}
}
}
@ -571,8 +576,11 @@ public class QbittorrentAdapter implements IDaemonAdapter {
@@ -571,8 +576,11 @@ public class QbittorrentAdapter implements IDaemonAdapter {
@ -594,7 +602,13 @@ public class QbittorrentAdapter implements IDaemonAdapter {
@@ -594,7 +602,13 @@ public class QbittorrentAdapter implements IDaemonAdapter {