@ -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,11 +94,16 @@ public class QbittorrentAdapter implements IDaemonAdapter {
@@ -95,11 +94,16 @@ public class QbittorrentAdapter implements IDaemonAdapter {
// Assume endpoint exists and is reachable, set lowest possible version and stop trying
apiVersion=(float)2.3;
}
// Keep trying
if(apiVersion<0){
if(is_v2){
// Preemptive assumption, for authentication
apiVersion=(float)2.3;
@ -121,6 +125,7 @@ public class QbittorrentAdapter implements IDaemonAdapter {
@@ -121,6 +125,7 @@ public class QbittorrentAdapter implements IDaemonAdapter {
apiVersion=1;
}
}
}
log.d(LOG_NAME,"qBittorrent API version is "+apiVersion);
@ -571,8 +576,11 @@ public class QbittorrentAdapter implements IDaemonAdapter {
@@ -571,8 +576,11 @@ public class QbittorrentAdapter implements IDaemonAdapter {
@ -594,8 +602,14 @@ public class QbittorrentAdapter implements IDaemonAdapter {
@@ -594,8 +602,14 @@ public class QbittorrentAdapter implements IDaemonAdapter {