Skip to content

Commit e32488b

Browse files
authored
Merge pull request #498 from crazy-max/rutorrent-patch
rutorrent: apply patches to fix deprecated rtorrent commands since 0.16
2 parents eb4a17a + 27ffb96 commit e32488b

3 files changed

Lines changed: 151 additions & 1 deletion

File tree

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ ARG ALPINE_VERSION=3.22
1717
ARG ALPINE_S6_VERSION=${ALPINE_VERSION}-2.2.0.3
1818

1919
FROM --platform=${BUILDPLATFORM} alpine:${ALPINE_VERSION} AS src
20-
RUN apk --update --no-cache add curl git tar tree sed xz
20+
RUN apk --update --no-cache add curl git patch tar tree sed xz
2121
WORKDIR /src
2222

2323
FROM src AS src-cares
@@ -52,6 +52,8 @@ FROM src AS src-rutorrent
5252
RUN git init . && git remote add origin "https://github.com/Novik/ruTorrent.git"
5353
ARG RUTORRENT_VERSION
5454
RUN git fetch origin "${RUTORRENT_VERSION}" && git checkout -q FETCH_HEAD
55+
COPY patches/rutorrent /tmp/rutorrent-patches
56+
RUN for f in /tmp/rutorrent-patches/*.patch; do echo "apply $f"; patch -p1 < $f; done
5557
RUN rm -rf .git* conf/users plugins/geoip share
5658

5759
FROM src AS src-geoip2-rutorrent
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
From 4fcff5305eba49f8d004899a766467a7d071d1f1 Mon Sep 17 00:00:00 2001
2+
From: simonc56 <simchat@gmail.com>
3+
Date: Sun, 9 Nov 2025 21:18:35 +0100
4+
Subject: [PATCH] alias rtorrent deprecated commands
5+
6+
---
7+
js/content.js | 11 +++++++++++
8+
js/rtorrent.js | 3 ++-
9+
php/methods-0.10.2.php | 9 +++++++++
10+
php/settings.php | 10 ++++++++--
11+
4 files changed, 30 insertions(+), 3 deletions(-)
12+
create mode 100644 php/methods-0.10.2.php
13+
14+
diff --git a/js/content.js b/js/content.js
15+
index 7f734455..98a2f8e9 100644
16+
--- a/js/content.js
17+
+++ b/js/content.js
18+
@@ -851,6 +851,17 @@ function correctContent()
19+
"load" : { name: "load.normal", prm: 1 }
20+
});
21+
}
22+
+ if(theWebUI.systemInfo.rTorrent.iVersion>=0x1002)
23+
+ {
24+
+ $.extend(theRequestManager.aliases,
25+
+ {
26+
+ "dht" : { name: "dht.mode.set", prm: 1 },
27+
+ "throttle.max_uploads.div" : { name: "throttle.max_uploads.div._val", prm: 1 },
28+
+ "throttle.max_uploads.global" : { name: "throttle.max_uploads.global._val", prm: 1 },
29+
+ "throttle.max_downloads.div" : { name: "throttle.max_downloads.div._val", prm: 1 },
30+
+ "throttle.max_downloads.global" : { name: "throttle.max_downloads.global._val", prm: 1 },
31+
+ });
32+
+ }
33+
if(theWebUI.systemInfo.rTorrent.iVersion < 0x907) {
34+
const title = theUILang.requiresAtLeastRtorrent.replace('{version}', 'v0.9.7');
35+
$($$('webui.show_open_status')).attr({ disabled: '', title });
36+
diff --git a/js/rtorrent.js b/js/rtorrent.js
37+
index a137ddba..8eace0b2 100644
38+
--- a/js/rtorrent.js
39+
+++ b/js/rtorrent.js
40+
@@ -379,7 +379,8 @@ rTorrentStub.prototype.setsettings = function()
41+
else
42+
prm = "auto";
43+
prmType = "string";
44+
- cmd = new rXMLRPCCommand('dht');
45+
+ cmd = new rXMLRPCCommand('dht.mode.set');
46+
+ cmd.addParameter("string",'');
47+
}
48+
else
49+
cmd = new rXMLRPCCommand('set_'+this.ss[i].substr(1));
50+
diff --git a/php/methods-0.10.2.php b/php/methods-0.10.2.php
51+
new file mode 100644
52+
index 00000000..c1031cb3
53+
--- /dev/null
54+
+++ b/php/methods-0.10.2.php
55+
@@ -0,0 +1,9 @@
56+
+<?php
57+
+
58+
+$this->aliases = array_merge($this->aliases,array(
59+
+"dht" => array( "name"=>"dht.mode.set", "prm"=>1 ),
60+
+"throttle.max_uploads.div" => array( "name"=>"throttle.max_uploads.div._val", "prm"=>1 ),
61+
+"throttle.max_uploads.global" => array( "name"=>"throttle.max_uploads.global._val", "prm"=>1 ),
62+
+"throttle.max_downloads.div" => array( "name"=>"throttle.max_downloads.div._val", "prm"=>1 ),
63+
+"throttle.max_downloads.global" => array( "name"=>"throttle.max_downloads.global._val", "prm"=>1 ),
64+
+));
65+
diff --git a/php/settings.php b/php/settings.php
66+
index c8ee7757..77c754a4 100644
67+
--- a/php/settings.php
68+
+++ b/php/settings.php
69+
@@ -220,7 +220,10 @@ class rTorrentSettings
70+
{
71+
require_once( 'methods-0.9.4.php' );
72+
}
73+
-
74+
+ if($this->iVersion>=0x1002)
75+
+ {
76+
+ require_once( 'methods-0.10.2.php' );
77+
+ }
78+
$this->apiVersion = 0;
79+
if($this->iVersion>=0x901)
80+
{
81+
@@ -230,7 +233,10 @@ class rTorrentSettings
82+
$this->apiVersion = $req->val[0];
83+
}
84+
85+
- $req = new rXMLRPCRequest( new rXMLRPCCommand("to_kb", floatval(1024)) );
86+
+ $req = new rXMLRPCRequest(new rXMLRPCCommand(
87+
+ "convert.kb",
88+
+ array('',floatval(1024))
89+
+ ));
90+
if($req->run())
91+
{
92+
if(!$req->fault)
93+
--
94+
2.46.0.windows.1
95+
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
From 5b1e02d103fe3fd991d885c44e85d9c3c339f14b Mon Sep 17 00:00:00 2001
2+
From: simonc56 <simchat@gmail.com>
3+
Date: Sun, 9 Nov 2025 21:19:01 +0100
4+
Subject: [PATCH] alias more rtorrent deprecated commands
5+
6+
---
7+
js/content.js | 10 ++++++++++
8+
php/methods-0.10.2.php | 10 ++++++++++
9+
2 files changed, 20 insertions(+)
10+
11+
diff --git a/js/content.js b/js/content.js
12+
index 98a2f8e9..5d5304a9 100644
13+
--- a/js/content.js
14+
+++ b/js/content.js
15+
@@ -860,6 +860,16 @@ function correctContent()
16+
"throttle.max_uploads.global" : { name: "throttle.max_uploads.global._val", prm: 1 },
17+
"throttle.max_downloads.div" : { name: "throttle.max_downloads.div._val", prm: 1 },
18+
"throttle.max_downloads.global" : { name: "throttle.max_downloads.global._val", prm: 1 },
19+
+ "ratio.enable" : { name: "group.seeding.ratio.enable", prm: 1 },
20+
+ "ratio.disable" : { name: "group.seeding.ratio.disable", prm: 1 },
21+
+ "ratio.min" : { name: "group2.seeding.ratio.min", prm: 0 },
22+
+ "ratio.max" : { name: "group2.seeding.ratio.max", prm: 0 },
23+
+ "ratio.upload" : { name: "group2.seeding.ratio.upload", prm: 0 },
24+
+ "ratio.min.set" : { name: "group2.seeding.ratio.min.set", prm: 1 },
25+
+ "ratio.max.set" : { name: "group2.seeding.ratio.max.set", prm: 1 },
26+
+ "ratio.upload.set" : { name: "group2.seeding.ratio.upload.set", prm: 1 },
27+
+ "connection_leech" : { name: "protocol.connection.leech.set", prm: 1 },
28+
+ "connection_seed" : { name: "protocol.connection.seed.set", prm: 1 },
29+
});
30+
}
31+
if(theWebUI.systemInfo.rTorrent.iVersion < 0x907) {
32+
diff --git a/php/methods-0.10.2.php b/php/methods-0.10.2.php
33+
index c1031cb3..6c6148a0 100644
34+
--- a/php/methods-0.10.2.php
35+
+++ b/php/methods-0.10.2.php
36+
@@ -6,4 +6,14 @@ $this->aliases = array_merge($this->aliases,array(
37+
"throttle.max_uploads.global" => array( "name"=>"throttle.max_uploads.global._val", "prm"=>1 ),
38+
"throttle.max_downloads.div" => array( "name"=>"throttle.max_downloads.div._val", "prm"=>1 ),
39+
"throttle.max_downloads.global" => array( "name"=>"throttle.max_downloads.global._val", "prm"=>1 ),
40+
+"ratio.enable" => array( "name"=>"group.seeding.ratio.enable", "prm"=>1 ),
41+
+"ratio.disable" => array( "name"=>"group.seeding.ratio.disable", "prm"=>1 ),
42+
+"ratio.min" => array( "name"=>"group2.seeding.ratio.min", "prm"=>0 ),
43+
+"ratio.max" => array( "name"=>"group2.seeding.ratio.max", "prm"=>0 ),
44+
+"ratio.upload" => array( "name"=>"group2.seeding.ratio.upload", "prm"=>0 ),
45+
+"ratio.min.set" => array( "name"=>"group2.seeding.ratio.min.set", "prm"=>1 ),
46+
+"ratio.max.set" => array( "name"=>"group2.seeding.ratio.max.set", "prm"=>1 ),
47+
+"ratio.upload.set" => array( "name"=>"group2.seeding.ratio.upload.set", "prm"=>1 ),
48+
+"connection_leech" => array( "name"=>"protocol.connection.leech.set", "prm"=>1 ),
49+
+"connection_seed" => array( "name"=>"protocol.connection.seed.set", "prm"=>1 ),
50+
));
51+
--
52+
2.46.0.windows.1
53+

0 commit comments

Comments
 (0)