Skip to content

Commit 651bde2

Browse files
committed
minor fix
1 parent 4473f8a commit 651bde2

File tree

4 files changed

+2
-151
lines changed

4 files changed

+2
-151
lines changed

plugins/autotools/util_rt.php

Lines changed: 1 addition & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -355,85 +355,4 @@ function rtExec( $cmds, $hash, $dbg )
355355
return null;
356356
}
357357
else return $req;
358-
}
359-
360-
//------------------------------------------------------------------------------
361-
// Make string param for XMLRPC call
362-
//------------------------------------------------------------------------------
363-
function rtMakeStrParam( $param )
364-
{
365-
return "<param><value><string>".$param."</string></value></param>";
366-
}
367-
368-
//------------------------------------------------------------------------------
369-
// Add ".torrent" file to rTorrent
370-
//------------------------------------------------------------------------------
371-
function rtAddTorrent( $fname, $isStart, $directory, $label, $dbg = false )
372-
{
373-
if( $isStart )
374-
$method = 'load_start_verbose';
375-
else
376-
$method = 'load_verbose';
377-
378-
if( $dbg ) rtDbg( __FUNCTION__, "1".$fname );
379-
$torrent = new Torrent($fname);
380-
if( $dbg ) rtDbg( __FUNCTION__, "2" );
381-
if( $torrent->errors() )
382-
{
383-
if( $dbg ) rtDbg( __FUNCTION__, "fail to create Torrent() object" );
384-
return false;
385-
}
386-
387-
if( $directory && strlen( $directory ) > 0 )
388-
{
389-
$directory = rtMakeStrParam( "d.set_directory=\"".$directory."\"" );
390-
}
391-
else $directory = "";
392-
393-
$comment = $torrent->comment();
394-
if( $comment && strlen( $comment ) > 0 )
395-
{
396-
if( isInvalidUTF8( $comment ) )
397-
$comment = win2utf($comment);
398-
if( strlen( $comment ) > 0 )
399-
{
400-
$comment = rtMakeStrParam( "d.set_custom2=VRS24mrker".rawurlencode( $comment ) );
401-
if(strlen($comment)>4096)
402-
$comment = '';
403-
}
404-
}
405-
else $comment = "";
406-
407-
if( $label && strlen( $label ) > 0 )
408-
{
409-
$label = rtMakeStrParam( "d.set_custom1=\"".rawurlencode( $label )."\"" );
410-
}
411-
else $label = "";
412-
413-
$addition = "";
414-
global $saveUploadedTorrents;
415-
$delete_tied = ($saveUploadedTorrents ? "" : rtMakeStrParam( "d.delete_tied=" ));
416-
417-
$content =
418-
'<?xml version="1.0" encoding="UTF-8"?>'.
419-
'<methodCall>'.
420-
'<methodName>'.$method.'</methodName>'.
421-
'<params>'.
422-
'<param><value><string>'.$fname.'</string></value></param>'.
423-
$directory.
424-
$comment.
425-
$label.
426-
$addition.
427-
$delete_tied.
428-
'</params></methodCall>';
429-
430-
//if( $dbg ) rtDbg( __FUNCTION__, $content );
431-
$res = rXMLRPCRequest::send( $content );
432-
433-
if( $dbg && !empty($res) ) rtDbg( __FUNCTION__, $res );
434-
435-
if( !$res || $res = '' )
436-
return false;
437-
else
438-
return $torrent->hash_info();
439-
}
358+
}

plugins/autotools/watch.php

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,6 @@ function Debug( $str )
7878

7979
if( $is_ok )
8080
{
81-
// $hash = rtAddTorrent(
82-
// $torrent_file, // path to .torrent file
83-
// $auto_start, // start it or not
84-
// $dest_path, // directory for torrent's data
85-
// null, // label is emply
86-
// $autodebug_enabled
87-
// );
8881
$hash = rTorrent::sendTorrent(
8982
$torrent_file, // path to .torrent file
9083
$auto_start, // start it or not
@@ -96,7 +89,7 @@ function Debug( $str )
9689
);
9790
if( $hash === false )
9891
{
99-
Debug( "rtAddTorrent() fail" );
92+
Debug( "addition of torrent fail" );
10093
$is_ok = false;
10194
}
10295
else {

plugins/extsearch/engines/ExtraTorrent.php

Lines changed: 0 additions & 61 deletions
This file was deleted.
-487 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)