From d570a0c1ae0c9b8c7187048f0183a787eb0d9251 Mon Sep 17 00:00:00 2001 From: iou1name Date: Sat, 31 Aug 2019 21:43:41 -0400 Subject: [PATCH] added rtorrent_id column --- rtorrent.py | 5 +++-- static/aberrant.css | 2 +- static/aberrant.js | 1 + templates/index.html | 2 ++ 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/rtorrent.py b/rtorrent.py index 987f383..52a2f71 100644 --- a/rtorrent.py +++ b/rtorrent.py @@ -15,7 +15,8 @@ sp = [] torrents = [[]] * NUM_INST class Torrent: - def __init__(self, raw): + def __init__(self, raw, rt_id): + self.rtorrent_id = rt_id self.hash = raw[0] self.name = raw[1] @@ -140,7 +141,7 @@ def get_all(n): 'd.message=', 'd.hashing=', ) - return [Torrent(raw) for raw in res] + return [Torrent(raw, n) for raw in res] def init(): """Initializes the rTorrent interface.""" diff --git a/static/aberrant.css b/static/aberrant.css index 4453881..c8b7b44 100644 --- a/static/aberrant.css +++ b/static/aberrant.css @@ -18,7 +18,7 @@ tr { padding-left: 0.5em; } -.totalSize, .state, .downrate, .downPercent, .eta, .uprate, .tracker { +.totalSize, .state, .downrate, .downPercent, .eta, .uprate, .tracker, .rt_id { text-align: center; width: 10%; } diff --git a/static/aberrant.js b/static/aberrant.js index 00c5d8c..ac229f0 100644 --- a/static/aberrant.js +++ b/static/aberrant.js @@ -20,6 +20,7 @@ function get_active_torrents() { html_str += '' + torrents[i].eta_str + ''; html_str += '' + torrents[i].uprate_str + ''; html_str += '' + torrents[i].tracker + ''; + html_str += '' + torrents[i].rtorrent_id + ''; html_str += ''; } document.getElementById('torrents').children[1].innerHTML = html_str; diff --git a/templates/index.html b/templates/index.html index 36450b4..a4fbff2 100644 --- a/templates/index.html +++ b/templates/index.html @@ -21,6 +21,7 @@ ETA UL Tracker + RT id @@ -34,6 +35,7 @@ {{ torrent.eta_str }} {{ torrent.uprate_str }} {{ torrent.tracker }} + {{ torrent.rtorrent_id }} {% endfor %}