@ -167,6 +168,8 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
@@ -167,6 +168,8 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
privatefinalDaemonSettingssettings;
privateintversion=-1;
publicDelugeRpcAdapter(DaemonSettingssettings){
this.settings=settings;
}
@ -235,13 +238,23 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
@@ -235,13 +238,23 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
@ -292,7 +305,8 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
@@ -292,7 +305,8 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
@ -300,19 +314,22 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
@@ -300,19 +314,22 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
@ -339,7 +356,8 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
@@ -339,7 +356,8 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
@ -348,7 +366,8 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
@@ -348,7 +366,8 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
@ -357,7 +376,8 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
@@ -357,7 +376,8 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
@ -371,32 +391,27 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
@@ -371,32 +391,27 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
@ -405,8 +420,8 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
@@ -405,8 +420,8 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
@ -416,23 +431,23 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
@@ -416,23 +431,23 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
@ -442,7 +457,8 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
@@ -442,7 +457,8 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
@ -462,9 +478,7 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
@@ -462,9 +478,7 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
}
// Now get all labels and add labels that have no torrents.
@ -473,7 +487,8 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
@@ -473,7 +487,8 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
@ -495,7 +510,7 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
@@ -495,7 +510,7 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
@ -503,7 +518,7 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
@@ -503,7 +518,7 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
torrent.getLocationDir()+path,
size,
(long)(size*progress),
convertDelugePriority(priority)));
convertDelugePriority(client,priority)));
}
returnfiles;
}
@ -560,8 +575,11 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
@@ -560,8 +575,11 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
// TODO: Move method to a common file used by both Adapters.
// Priority codes changes from Deluge 1.3.3 onwards
switch(priority){
case0:
returnPriority.Off;
@ -572,11 +590,25 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
@@ -572,11 +590,25 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
default:
returnPriority.Normal;
}
}else{
switch(priority){
case0:
returnPriority.Off;
case2:
returnPriority.Normal;
case5:
returnPriority.High;
default:
returnPriority.Low;
}
}
}
// TODO: Move method to a common file used by both Adapters.
// Priority codes changes from Deluge 1.3.3 onwards
switch(priority){
caseOff:
return0;
@ -587,48 +619,53 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
@@ -587,48 +619,53 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
default:
return5;
}
}else{
switch(priority){
caseOff:
return0;
caseNormal:
return2;
caseHigh:
return5;
default:
return1;
}
// The API seems to change the type it uses for numbers depending on their value so the same field
// can be sent as an int if it's small but will be sent as a long if it's larger than an int.
// Similarly, a float can be sent as an int for example, if it's zero.
// Because of this, we need these methods to safely unbox numbers.