@ -141,28 +141,28 @@ public class RtorrentAdapter implements IDaemonAdapter {
case GetTorrentDetails :
case GetTorrentDetails :
// @formatter:off
// @formatter:off
Object dresult = makeRtorrentCall ( log , "t.multicall" , new String [ ] {
Object dresult = makeRtorrentCall ( log , "t.multicall" , new String [ ] {
task . getTargetTorrent ( ) . getUniqueID ( ) ,
task . getTargetTorrent ( ) . getUniqueID ( ) ,
"" ,
"" ,
"t.url=" } ) ;
"t.url=" } ) ;
// @formatter:on
// @formatter:on
return new GetTorrentDetailsTaskSuccessResult ( ( GetTorrentDetailsTask ) task ,
return new GetTorrentDetailsTaskSuccessResult ( ( GetTorrentDetailsTask ) task ,
onTorrentDetailsRetrieved ( log , dresult ) ) ;
onTorrentDetailsRetrieved ( log , dresult ) ) ;
case GetFileList :
case GetFileList :
// @formatter:off
// @formatter:off
Object fresult = makeRtorrentCall ( log , "f.multicall" , new String [ ] {
Object fresult = makeRtorrentCall ( log , "f.multicall" , new String [ ] {
task . getTargetTorrent ( ) . getUniqueID ( ) ,
task . getTargetTorrent ( ) . getUniqueID ( ) ,
"" ,
"" ,
"f.path=" ,
"f.path=" ,
"f.size_bytes=" ,
"f.size_bytes=" ,
"f.priority=" ,
"f.priority=" ,
"f.completed_chunks=" ,
"f.completed_chunks=" ,
"f.size_chunks=" ,
"f.size_chunks=" ,
"f.priority=" ,
"f.priority=" ,
"f.frozen_path=" } ) ;
"f.frozen_path=" } ) ;
// @formatter:on
// @formatter:on
return new GetFileListTaskSuccessResult ( ( GetFileListTask ) task ,
return new GetFileListTaskSuccessResult ( ( GetFileListTask ) task ,
onTorrentFilesRetrieved ( fresult , task . getTargetTorrent ( ) ) ) ;
onTorrentFilesRetrieved ( fresult , task . getTargetTorrent ( ) ) ) ;
@ -179,7 +179,7 @@ public class RtorrentAdapter implements IDaemonAdapter {
}
}
byte [ ] bytes = baos . toByteArray ( ) ;
byte [ ] bytes = baos . toByteArray ( ) ;
int size = Math . max ( ( ( int ) file . length ( ) * 2 ) + XMLRPC_EXTRA_PADDING , XMLRPC_MINIMUM_SIZE ) ;
int size = Math . max ( ( ( int ) file . length ( ) * 2 ) + XMLRPC_EXTRA_PADDING , XMLRPC_MINIMUM_SIZE ) ;
if ( version > = 907 ) {
if ( version > = 904 ) {
makeRtorrentCall ( log , "network.xmlrpc.size_limit.set" , new Object [ ] { size + XMLRPC_EXTRA_PADDING } ) ;
makeRtorrentCall ( log , "network.xmlrpc.size_limit.set" , new Object [ ] { size + XMLRPC_EXTRA_PADDING } ) ;
makeRtorrentCall ( log , "load.raw_start" , new Object [ ] { bytes } ) ;
makeRtorrentCall ( log , "load.raw_start" , new Object [ ] { bytes } ) ;
} else {
} else {
@ -192,7 +192,7 @@ public class RtorrentAdapter implements IDaemonAdapter {
// Request to add a torrent by URL
// Request to add a torrent by URL
String url = ( ( AddByUrlTask ) task ) . getUrl ( ) ;
String url = ( ( AddByUrlTask ) task ) . getUrl ( ) ;
if ( version > = 907 ) {
if ( version > = 904 ) {
makeRtorrentCall ( log , "load.start" , new String [ ] { "" , url } ) ;
makeRtorrentCall ( log , "load.start" , new String [ ] { "" , url } ) ;
} else {
} else {
makeRtorrentCall ( log , "load_start" , new String [ ] { url } ) ;
makeRtorrentCall ( log , "load_start" , new String [ ] { url } ) ;
@ -203,7 +203,7 @@ public class RtorrentAdapter implements IDaemonAdapter {
// Request to add a magnet link by URL
// Request to add a magnet link by URL
String magnet = ( ( AddByMagnetUrlTask ) task ) . getUrl ( ) ;
String magnet = ( ( AddByMagnetUrlTask ) task ) . getUrl ( ) ;
if ( version > = 907 ) {
if ( version > = 904 ) {
makeRtorrentCall ( log , "load.start" , new String [ ] { "" , magnet } ) ;
makeRtorrentCall ( log , "load.start" , new String [ ] { "" , magnet } ) ;
} else {
} else {
makeRtorrentCall ( log , "load_start" , new String [ ] { magnet } ) ;
makeRtorrentCall ( log , "load_start" , new String [ ] { magnet } ) ;