@ -85,11 +85,10 @@ public class TorrentDetailsView extends RelativeLayout {
@@ -85,11 +85,10 @@ public class TorrentDetailsView extends RelativeLayout {
@ -467,10 +467,10 @@ public class BitCometAdapter implements IDaemonAdapter {
@@ -467,10 +467,10 @@ public class BitCometAdapter implements IDaemonAdapter {
null,
rateDown,
rateUp,
leechers,
seeders,
knownLeechers,
knownSeeders,
leechers,
knownLeechers,
(rateDown==0?-1:(int)((size-sizeDone)/rateDown)),
sizeDone,
sizeUp,
@ -545,10 +545,10 @@ public class BitCometAdapter implements IDaemonAdapter {
@@ -545,10 +545,10 @@ public class BitCometAdapter implements IDaemonAdapter {
null,
rateDown,
rateUp,
leechers,
seeders,
seeders+leechers,
seedersTotal+leechersTotal,
seedersTotal,
leechers,
leechersTotal,
(int)((status==TorrentStatus.Downloading&&rateDown!=0)?(totalSize-sizeDone)/rateDown:-1),// eta (in seconds) = (total_size_in_btes - bytes_already_downloaded) / bytes_per_second
@ -108,25 +106,27 @@ public class BitfluAdapter implements IDaemonAdapter {
@@ -108,25 +106,27 @@ public class BitfluAdapter implements IDaemonAdapter {
@ -157,15 +157,16 @@ public class BitfluAdapter implements IDaemonAdapter {
@@ -157,15 +157,16 @@ public class BitfluAdapter implements IDaemonAdapter {
@ -200,10 +202,10 @@ public class BitfluAdapter implements IDaemonAdapter {
@@ -200,10 +202,10 @@ public class BitfluAdapter implements IDaemonAdapter {
"/"+settings.getOS().getPathSeperator(),
tor.getInt("speed_download"),
tor.getInt("speed_upload"),
0,// 'uploading to'
tor.getInt("active_clients"),
tor.getInt("active_clients"),// Bitflu doesn't distinguish between seeders and leechers
tor.getInt("clients"),
tor.getInt("clients"),
tor.getInt("clients"),// Bitflu doesn't distinguish between seeders and leechers
tor.getInt("eta"),
done_bytes,
tor.getLong("uploaded_bytes"),
@ -215,27 +217,28 @@ public class BitfluAdapter implements IDaemonAdapter {
@@ -215,27 +217,28 @@ public class BitfluAdapter implements IDaemonAdapter {
@ -245,19 +248,18 @@ public class BitfluAdapter implements IDaemonAdapter {
@@ -245,19 +248,18 @@ public class BitfluAdapter implements IDaemonAdapter {
@ -88,35 +86,44 @@ public class BuffaloNasAdapter implements IDaemonAdapter {
@@ -88,35 +86,44 @@ public class BuffaloNasAdapter implements IDaemonAdapter {
@ -135,13 +142,22 @@ public class BuffaloNasAdapter implements IDaemonAdapter {
@@ -135,13 +142,22 @@ public class BuffaloNasAdapter implements IDaemonAdapter {
@ -251,15 +267,17 @@ public class BuffaloNasAdapter implements IDaemonAdapter {
@@ -251,15 +267,17 @@ public class BuffaloNasAdapter implements IDaemonAdapter {
@ -268,10 +286,10 @@ public class BuffaloNasAdapter implements IDaemonAdapter {
@@ -268,10 +286,10 @@ public class BuffaloNasAdapter implements IDaemonAdapter {
null,
rateDown,
rateUp,
leechers,
leechers+seeders,
known,
known,
seedsConnected,
seedsTotal,
peersConnected,
peersTotal,
(rateDown==0?-1:(int)((size-sizeDone)/rateDown)),
sizeDone,
sizeUp,
@ -283,6 +301,7 @@ public class BuffaloNasAdapter implements IDaemonAdapter {
@@ -283,6 +301,7 @@ public class BuffaloNasAdapter implements IDaemonAdapter {
null,
null,
settings.getType()));
// @formatter:on
}
// Return the list
@ -317,6 +336,7 @@ public class BuffaloNasAdapter implements IDaemonAdapter {
@@ -317,6 +336,7 @@ public class BuffaloNasAdapter implements IDaemonAdapter {
JSONObjectfile=all.getJSONObject(i);
longsize=file.getLong("size");
longsizeDone=file.getLong("done");
// @formatter:off
torrentfiles.add(newTorrentFile(
""+file.getInt("id"),
file.getString("name"),
@ -325,6 +345,7 @@ public class BuffaloNasAdapter implements IDaemonAdapter {
@@ -325,6 +345,7 @@ public class BuffaloNasAdapter implements IDaemonAdapter {
@ -93,8 +93,8 @@ public class DLinkRouterBTAdapter implements IDaemonAdapter {
@@ -93,8 +93,8 @@ public class DLinkRouterBTAdapter implements IDaemonAdapter {
@ -363,9 +363,9 @@ public class DLinkRouterBTAdapter implements IDaemonAdapter {
@@ -363,9 +363,9 @@ public class DLinkRouterBTAdapter implements IDaemonAdapter {
@ -125,10 +125,10 @@ public class DelugeAdapter implements IDaemonAdapter {
@@ -125,10 +125,10 @@ public class DelugeAdapter implements IDaemonAdapter {
@ -588,10 +588,10 @@ public class DelugeAdapter implements IDaemonAdapter {
@@ -588,10 +588,10 @@ public class DelugeAdapter implements IDaemonAdapter {
(int)(status==TorrentStatus.Downloading?(total-down)/downRate:-1),// eta (in seconds) = (total_size_in_btes - bytes_already_downloaded) / bytes_per_second
@ -374,9 +374,8 @@ public class QbittorrentAdapter implements IDaemonAdapter {
@@ -374,9 +374,8 @@ public class QbittorrentAdapter implements IDaemonAdapter {
@ -387,8 +386,8 @@ public class QbittorrentAdapter implements IDaemonAdapter {
@@ -387,8 +386,8 @@ public class QbittorrentAdapter implements IDaemonAdapter {
// Date added is only available in /json/propertiesGeneral on a per-torrent basis, unfortunately
@ -439,41 +438,15 @@ public class QbittorrentAdapter implements IDaemonAdapter {
@@ -439,41 +438,15 @@ public class QbittorrentAdapter implements IDaemonAdapter {
return(long)number;
}
privateintparseKnown(Stringleechs,Stringseeds){
// Peers are given in the "num_leechs":"91 (449)","num_seeds":"6 (27)" strings
// Or sometimes just "num_leechs":"91","num_seeds":"6" strings
// Peers known are in the last () bit of the leechers and seeders
@ -96,23 +94,68 @@ public class RtorrentAdapter implements IDaemonAdapter {
@@ -96,23 +94,68 @@ public class RtorrentAdapter implements IDaemonAdapter {
@ -130,14 +173,14 @@ public class RtorrentAdapter implements IDaemonAdapter {
@@ -130,14 +173,14 @@ public class RtorrentAdapter implements IDaemonAdapter {
@ -160,7 +203,7 @@ public class RtorrentAdapter implements IDaemonAdapter {
@@ -160,7 +203,7 @@ public class RtorrentAdapter implements IDaemonAdapter {
@ -172,7 +215,7 @@ public class RtorrentAdapter implements IDaemonAdapter {
@@ -172,7 +215,7 @@ public class RtorrentAdapter implements IDaemonAdapter {
@ -184,7 +227,7 @@ public class RtorrentAdapter implements IDaemonAdapter {
@@ -184,7 +227,7 @@ public class RtorrentAdapter implements IDaemonAdapter {
@ -196,7 +239,7 @@ public class RtorrentAdapter implements IDaemonAdapter {
@@ -196,7 +239,7 @@ public class RtorrentAdapter implements IDaemonAdapter {
@ -206,7 +249,8 @@ public class RtorrentAdapter implements IDaemonAdapter {
@@ -206,7 +249,8 @@ public class RtorrentAdapter implements IDaemonAdapter {
@ -214,14 +258,17 @@ public class RtorrentAdapter implements IDaemonAdapter {
@@ -214,14 +258,17 @@ public class RtorrentAdapter implements IDaemonAdapter {
@ -231,7 +278,8 @@ public class RtorrentAdapter implements IDaemonAdapter {
@@ -231,7 +278,8 @@ public class RtorrentAdapter implements IDaemonAdapter {
returnnewDaemonTaskSuccessResult(task);
default:
returnnewDaemonTaskFailureResult(task,newDaemonException(ExceptionType.MethodUnsupported,task.getMethod()+" is not supported by "+getType()));
task.getMethod()+" is not supported by "+getType()));
}
}catch(DaemonExceptione){
returnnewDaemonTaskFailureResult(task,e);
@ -242,7 +290,8 @@ public class RtorrentAdapter implements IDaemonAdapter {
@@ -242,7 +290,8 @@ public class RtorrentAdapter implements IDaemonAdapter {
@ -250,9 +299,12 @@ public class RtorrentAdapter implements IDaemonAdapter {
@@ -250,9 +299,12 @@ public class RtorrentAdapter implements IDaemonAdapter {
@ -260,7 +312,9 @@ public class RtorrentAdapter implements IDaemonAdapter {
@@ -260,7 +312,9 @@ public class RtorrentAdapter implements IDaemonAdapter {
thrownewDaemonException(ExceptionType.ConnectionError,"Error making call to "+serverMethod+" with params ["+(params.length()>100?params.substring(0,100)+"...":params)+" ]: "+e.toString());
thrownewDaemonException(ExceptionType.ConnectionError,"Error making call to "+serverMethod
+" with params ["+(params.length()>100?params.substring(0,100)+"...":params)+" ]: "
+e.toString());
}
}
@ -282,15 +336,20 @@ public class RtorrentAdapter implements IDaemonAdapter {
@@ -282,15 +336,20 @@ public class RtorrentAdapter implements IDaemonAdapter {
"Response on retrieveing torrents did not return a list of objects");
}else{
@ -302,8 +361,8 @@ public class RtorrentAdapter implements IDaemonAdapter {
@@ -302,8 +361,8 @@ public class RtorrentAdapter implements IDaemonAdapter {
for(inti=0;i<responseList.length;i++){
Object[]info=(Object[])responseList[i];
Stringerror=(String)info[18];
error=error.equals("")?null:error;
Stringerror=(String)info[18];
error=error.equals("")?null:error;
// Determine the time added
Dateadded=null;
@ -319,9 +378,9 @@ public class RtorrentAdapter implements IDaemonAdapter {
@@ -319,9 +378,9 @@ public class RtorrentAdapter implements IDaemonAdapter {
else{
// rTorrent didn't have the addtime (missing plugin?): base it on creationtime instead
if(info[11]instanceofLong)
added=newDate((Long)info[11]*1000L);
added=newDate((Long)info[11]*1000L);
else
added=newDate((Integer)info[11]*1000L);
added=newDate((Integer)info[11]*1000L);
}
// Determine the seeding time
@ -339,7 +398,7 @@ public class RtorrentAdapter implements IDaemonAdapter {
@@ -339,7 +398,7 @@ public class RtorrentAdapter implements IDaemonAdapter {
@ -352,9 +411,10 @@ public class RtorrentAdapter implements IDaemonAdapter {
@@ -352,9 +411,10 @@ public class RtorrentAdapter implements IDaemonAdapter {
if(info[3]instanceofLong){
// rTorrent uses the i8 dialect which returns 64-bit integers
longrateDownload=(Long)info[3];
StringbasePath=(String)info[16];
longrateDownload=(Long)info[3];
StringbasePath=(String)info[16];
// @formatter:off
torrents.add(newTorrent(
i,
(String)info[0],// hash
@ -363,10 +423,10 @@ public class RtorrentAdapter implements IDaemonAdapter {
@@ -363,10 +423,10 @@ public class RtorrentAdapter implements IDaemonAdapter {
(rateDownload>0?(int)(((Long)info[12])/rateDownload):-1),// eta (bytes left / rate download, if rate > 0)
(Long)info[8],// downloadedEver
(Long)info[9],// uploadedEver
@ -378,13 +438,15 @@ public class RtorrentAdapter implements IDaemonAdapter {
@@ -378,13 +438,15 @@ public class RtorrentAdapter implements IDaemonAdapter {
finished,
error,
settings.getType()));
// @formatter:on
}else{
// rTorrent uses the default dialect with 32-bit integers
intrateDownload=(Integer)info[3];
StringbasePath=(String)info[16];
intrateDownload=(Integer)info[3];
StringbasePath=(String)info[16];
// @formatter:off
torrents.add(newTorrent(
i,
(String)info[0],// hash
@ -393,10 +455,10 @@ public class RtorrentAdapter implements IDaemonAdapter {
@@ -393,10 +455,10 @@ public class RtorrentAdapter implements IDaemonAdapter {
(rateDownload>0?(int)((Integer)info[12]/rateDownload):-1),// eta (bytes left / rate download, if rate > 0)
(Integer)info[8],// downloadedEver
(Integer)info[9],// uploadedEver
@ -408,6 +470,7 @@ public class RtorrentAdapter implements IDaemonAdapter {
@@ -408,6 +470,7 @@ public class RtorrentAdapter implements IDaemonAdapter {
finished,
error,
settings.getType()));
// @formatter:on
}
}
@ -426,13 +489,14 @@ public class RtorrentAdapter implements IDaemonAdapter {
@@ -426,13 +489,14 @@ public class RtorrentAdapter implements IDaemonAdapter {
@ -440,11 +504,12 @@ public class RtorrentAdapter implements IDaemonAdapter {
@@ -440,11 +504,12 @@ public class RtorrentAdapter implements IDaemonAdapter {
if(info[1]instanceofLong){
// rTorrent uses the i8 dialect which returns 64-bit integers
Longsize=(Long)info[1];
LongchunksDone=(Long)info[3];
LongchunksTotal=(Long)info[4];
Longpriority=(Long)info[5];
Longsize=(Long)info[1];
LongchunksDone=(Long)info[3];
LongchunksTotal=(Long)info[4];
Longpriority=(Long)info[5];
// @formatter:off
files.add(newTorrentFile(
""+i,
(String)info[0],// name
@ -453,16 +518,17 @@ public class RtorrentAdapter implements IDaemonAdapter {
@@ -453,16 +518,17 @@ public class RtorrentAdapter implements IDaemonAdapter {
// rTorrent uses the default dialect with 32-bit integers
Integersize=(Integer)info[1];
IntegerchunksDone=(Integer)info[3];
IntegerchunksTotal=(Integer)info[4];
Integerpriority=(Integer)info[5];
Integersize=(Integer)info[1];
IntegerchunksDone=(Integer)info[3];
IntegerchunksTotal=(Integer)info[4];
Integerpriority=(Integer)info[5];
// @formatter:off
files.add(newTorrentFile(
""+i,
(String)info[0],// name
@ -471,7 +537,7 @@ public class RtorrentAdapter implements IDaemonAdapter {
@@ -471,7 +537,7 @@ public class RtorrentAdapter implements IDaemonAdapter {
@ -525,7 +591,8 @@ public class RtorrentAdapter implements IDaemonAdapter {
@@ -525,7 +591,8 @@ public class RtorrentAdapter implements IDaemonAdapter {
@ -294,14 +294,15 @@ public class SynologyAdapter implements IDaemonAdapter {
@@ -294,14 +294,15 @@ public class SynologyAdapter implements IDaemonAdapter {
@ -313,10 +314,10 @@ public class SynologyAdapter implements IDaemonAdapter {
@@ -313,10 +314,10 @@ public class SynologyAdapter implements IDaemonAdapter {
@ -39,10 +37,10 @@ public final class Torrent implements Parcelable, Comparable<Torrent>, Finishabl
@@ -39,10 +37,10 @@ public final class Torrent implements Parcelable, Comparable<Torrent>, Finishabl
finalprivateintrateDownload;
finalprivateintrateUpload;
finalprivateintpeersGettingFromUs;
finalprivateintpeersSendingToUs;
finalprivateintpeersConnected;
finalprivateintpeersKnown;
finalprivateintseedersConnected;
finalprivateintseedersKnown;
finalprivateintleechersConnected;
finalprivateintleechersKnown;
finalprivateinteta;
finalprivatelongdownloadedEver;
@ -57,32 +55,6 @@ public final class Torrent implements Parcelable, Comparable<Torrent>, Finishabl
@@ -57,32 +55,6 @@ public final class Torrent implements Parcelable, Comparable<Torrent>, Finishabl
@ -92,10 +64,10 @@ public final class Torrent implements Parcelable, Comparable<Torrent>, Finishabl
@@ -92,10 +64,10 @@ public final class Torrent implements Parcelable, Comparable<Torrent>, Finishabl
this.rateDownload=in.readInt();
this.rateUpload=in.readInt();
this.peersGettingFromUs=in.readInt();
this.peersSendingToUs=in.readInt();
this.peersConnected=in.readInt();
this.peersKnown=in.readInt();
this.seedersConnected=in.readInt();
this.seedersKnown=in.readInt();
this.leechersConnected=in.readInt();
this.leechersKnown=in.readInt();
this.eta=in.readInt();
this.downloadedEver=in.readLong();
@ -106,15 +78,15 @@ public final class Torrent implements Parcelable, Comparable<Torrent>, Finishabl
@@ -106,15 +78,15 @@ public final class Torrent implements Parcelable, Comparable<Torrent>, Finishabl
@ -125,10 +97,10 @@ public final class Torrent implements Parcelable, Comparable<Torrent>, Finishabl
@@ -125,10 +97,10 @@ public final class Torrent implements Parcelable, Comparable<Torrent>, Finishabl
this.rateDownload=rateDownload;
this.rateUpload=rateUpload;
this.peersGettingFromUs=peersGettingFromUs;
this.peersSendingToUs=peersSendingToUs;
this.peersConnected=peersConnected;
this.peersKnown=peersKnown;
this.seedersConnected=seedersConnected;
this.seedersKnown=seedersKnown;
this.leechersConnected=leechersConnected;
this.leechersKnown=leechersKnown;
this.eta=eta;
this.downloadedEver=downloadedEver;
@ -161,6 +133,86 @@ public final class Torrent implements Parcelable, Comparable<Torrent>, Finishabl
@@ -161,6 +133,86 @@ public final class Torrent implements Parcelable, Comparable<Torrent>, Finishabl
@ -178,7 +230,7 @@ public final class Torrent implements Parcelable, Comparable<Torrent>, Finishabl
@@ -178,7 +230,7 @@ public final class Torrent implements Parcelable, Comparable<Torrent>, Finishabl
@ -258,7 +310,8 @@ public final class Torrent implements Parcelable, Comparable<Torrent>, Finishabl
@@ -258,7 +310,8 @@ public final class Torrent implements Parcelable, Comparable<Torrent>, Finishabl
*/
publicbooleancanStop(){
// Can stop when it is downloading or seeding or paused
@ -300,7 +353,7 @@ public final class Torrent implements Parcelable, Comparable<Torrent>, Finishabl
@@ -300,7 +353,7 @@ public final class Torrent implements Parcelable, Comparable<Torrent>, Finishabl
@ -334,10 +387,10 @@ public final class Torrent implements Parcelable, Comparable<Torrent>, Finishabl
@@ -334,10 +387,10 @@ public final class Torrent implements Parcelable, Comparable<Torrent>, Finishabl
dest.writeInt(rateDownload);
dest.writeInt(rateUpload);
dest.writeInt(peersGettingFromUs);
dest.writeInt(peersSendingToUs);
dest.writeInt(peersConnected);
dest.writeInt(peersKnown);
dest.writeInt(seedersConnected);
dest.writeInt(seedersKnown);
dest.writeInt(leechersConnected);
dest.writeInt(leechersKnown);
dest.writeInt(eta);
dest.writeLong(downloadedEver);
@ -347,8 +400,8 @@ public final class Torrent implements Parcelable, Comparable<Torrent>, Finishabl
@@ -347,8 +400,8 @@ public final class Torrent implements Parcelable, Comparable<Torrent>, Finishabl
@ -95,7 +95,6 @@ public class TransmissionAdapter implements IDaemonAdapter {
@@ -95,7 +95,6 @@ public class TransmissionAdapter implements IDaemonAdapter {
@ -504,9 +503,9 @@ public class TransmissionAdapter implements IDaemonAdapter {
@@ -504,9 +503,9 @@ public class TransmissionAdapter implements IDaemonAdapter {
@ -516,9 +516,9 @@ public class UtorrentAdapter implements IDaemonAdapter {
@@ -516,9 +516,9 @@ public class UtorrentAdapter implements IDaemonAdapter {