@ -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
@ -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,13 +217,13 @@ public class BitfluAdapter implements IDaemonAdapter {
@@ -215,13 +217,13 @@ public class BitfluAdapter implements IDaemonAdapter {
@ -236,6 +238,7 @@ public class BitfluAdapter implements IDaemonAdapter {
@@ -236,6 +238,7 @@ public class BitfluAdapter implements IDaemonAdapter {
done_bytes=file_size;
}
// @formatter:off
files.add(newTorrentFile(
""+i,
finfo.getString("name"),
@ -245,19 +248,18 @@ public class BitfluAdapter implements IDaemonAdapter {
@@ -245,19 +248,18 @@ public class BitfluAdapter implements IDaemonAdapter {
@ -94,7 +92,8 @@ public class BuffaloNasAdapter implements IDaemonAdapter {
@@ -94,7 +92,8 @@ public class BuffaloNasAdapter implements IDaemonAdapter {
@ -108,15 +107,23 @@ public class BuffaloNasAdapter implements IDaemonAdapter {
@@ -108,15 +107,23 @@ 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,18 +94,63 @@ public class RtorrentAdapter implements IDaemonAdapter {
@@ -96,18 +94,63 @@ 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{
@ -355,6 +414,7 @@ public class RtorrentAdapter implements IDaemonAdapter {
@@ -355,6 +414,7 @@ public class RtorrentAdapter implements IDaemonAdapter {
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,6 +438,7 @@ public class RtorrentAdapter implements IDaemonAdapter {
@@ -378,6 +438,7 @@ public class RtorrentAdapter implements IDaemonAdapter {
finished,
error,
settings.getType()));
// @formatter:on
}else{
@ -385,6 +446,7 @@ public class RtorrentAdapter implements IDaemonAdapter {
@@ -385,6 +446,7 @@ public class RtorrentAdapter implements IDaemonAdapter {
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,7 +489,8 @@ public class RtorrentAdapter implements IDaemonAdapter {
@@ -426,7 +489,8 @@ public class RtorrentAdapter implements IDaemonAdapter {
"Response on retrieveing torrent files did not return a list of objects");
}else{
@ -445,6 +509,7 @@ public class RtorrentAdapter implements IDaemonAdapter {
@@ -445,6 +509,7 @@ public class RtorrentAdapter implements IDaemonAdapter {
LongchunksTotal=(Long)info[4];
Longpriority=(Long)info[5];
// @formatter:off
files.add(newTorrentFile(
""+i,
(String)info[0],// name
@ -453,7 +518,7 @@ public class RtorrentAdapter implements IDaemonAdapter {
@@ -453,7 +518,7 @@ public class RtorrentAdapter implements IDaemonAdapter {
@ -463,6 +528,7 @@ public class RtorrentAdapter implements IDaemonAdapter {
@@ -463,6 +528,7 @@ public class RtorrentAdapter implements IDaemonAdapter {
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();
@ -113,8 +85,8 @@ public final class Torrent implements Parcelable, Comparable<Torrent>, Finishabl
@@ -113,8 +85,8 @@ 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
@ -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
@ -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
@ -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 {