@ -80,20 +80,51 @@ public class QbittorrentAdapter implements IDaemonAdapter {
@@ -80,20 +80,51 @@ public class QbittorrentAdapter implements IDaemonAdapter {
privateDaemonSettingssettings;
privateDefaultHttpClienthttpclient;
privateintversion=-1;
publicQbittorrentAdapter(DaemonSettingssettings){
this.settings=settings;
}
privatevoidensureVersion()throwsDaemonException{
if(version>0)
return;
// We still need to retrieve the version number from the server
// Do this by getting the web interface about page and trying to parse the version number
// Format is something like 'qBittorrent v2.9.7 (Web UI)'
Stringabout=makeRequest("/about.html");
StringaboutStartText="qBittorrent v";
StringaboutEndText=" (Web UI)";
intaboutStart=about.indexOf(aboutStartText);
intaboutEnd=about.indexOf(aboutEndText);
if(aboutStart>=0&&aboutEnd>aboutStart){
// String found: now parse a version like 2.9.7 as a number like 20907 (allowing 10 places for each .)
@ -475,7 +475,7 @@ public class TransmissionAdapter implements IDaemonAdapter {
@@ -475,7 +475,7 @@ public class TransmissionAdapter implements IDaemonAdapter {