ソースを参照

rTorrent different endpoints - Fix #1072

causefx 7 年 前
コミット
9dda0a7633

+ 1 - 0
api/config/default.php

@@ -79,6 +79,7 @@ return array(
 	'qBittorrentReverseSorting' => false,
 	'qBittorrentCombine' => false,
 	'rTorrentURL' => '',
+	'rTorrentURLOverride' => '',
 	'rTorrentUsername' => '',
 	'rTorrentPassword' => '',
 	'rTorrentHideSeeding' => false,

+ 1 - 0
api/functions/homepage-connect-functions.php

@@ -796,6 +796,7 @@ function rTorrentConnect()
 			$digest = qualifyURL($GLOBALS['rTorrentURL'], true);
 			$passwordInclude = ($GLOBALS['rTorrentUsername'] != '' && $GLOBALS['rTorrentPassword'] != '') ? $GLOBALS['rTorrentUsername'] . ':' . decrypt($GLOBALS['rTorrentPassword']) . "@" : '';
 			$extraPath = (strpos($GLOBALS['rTorrentURL'], '.php') !== false) ? '' : '/RPC2';
+			$extraPath = (empty($GLOBALS['rTorrentURLOverride'])) ? $extraPath : '';
 			$url = $digest['scheme'] . '://' . $passwordInclude . $digest['host'] . $digest['port'] . $digest['path'] . $extraPath;
 			$options = (localURL($url)) ? array('verify' => false) : array();
 			$data = xmlrpc_encode_request("d.multicall2", array(

+ 9 - 1
api/functions/homepage-functions.php

@@ -1308,9 +1308,17 @@ function getHomepageList()
 						'name' => 'rTorrentURL',
 						'label' => 'URL',
 						'value' => $GLOBALS['rTorrentURL'],
-						'help' => 'Please make sure to use local IP address and port - You also may use local dns name too.',
+						'help' => 'Only use if you cannot connect.  Please make sure to use local IP address and port - You also may use local dns name too.',
 						'placeholder' => 'http(s)://hostname:port'
 					),
+					array(
+						'type' => 'input',
+						'name' => 'rTorrentURLOverride',
+						'label' => 'rTorrent API URL Override',
+						'value' => $GLOBALS['rTorrentURLOverride'],
+						'help' => 'Please make sure to use local IP address and port - You also may use local dns name too.',
+						'placeholder' => 'http(s)://hostname:port/xmlrpc'
+					),
 					array(
 						'type' => 'input',
 						'name' => 'rTorrentUsername',