diff --git a/README.md b/README.md index a4a1f71..dba9dc2 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,3 @@ Python packages: `flask gunicorn` ## Usage `gunicorn -b localhost:5250 -e SCRIPT_NAME=/aberrant aberrant:app` - -## What's with the name? -Picked a random word from the dictionary desu. diff --git a/rtorrent.py b/rtorrent.py index 923d38f..799cc80 100644 --- a/rtorrent.py +++ b/rtorrent.py @@ -31,6 +31,8 @@ class Torrent: self.uprate = raw[5] self.uprate_str = speedrate(self.uprate) + self.tracker = get_tracker(raw[6]) + class Watch(threading.Thread): """A thread class that continously queries the rTorrent instances.""" @@ -66,6 +68,14 @@ def speedrate(rate): rate = round(rate, 1) return str(rate) + unit +def get_tracker(path): + """ + At present I don't have an efficient way to get the tracker url + with the d.multicall2() function, so we parse it from the + directory path. + """ + return path.split('/')[4] + def all_torrents(): """Helper that returns a list of all torrents.""" res = [] @@ -89,6 +99,7 @@ def get_all(n): 'd.complete=', 'd.down.rate=', 'd.up.rate=', + 'd.directory=', ) return [Torrent(raw) for raw in res] diff --git a/static/aberrant.css b/static/aberrant.css index a2b49c9..90e95e5 100644 --- a/static/aberrant.css +++ b/static/aberrant.css @@ -1,3 +1,9 @@ +body { + background-color: #FAFAFA; + color: #111111; + font-family: Tahoma, Helvetica, sans-serif; +} + #torrents { width: 100%; border-collapse: collapse; @@ -8,21 +14,11 @@ tr { border: 1px solid #ccc; } -.name { +#name { padding-left: 1em; } -.state { - text-align: center; - width: 10%; -} - -.downrate { - text-align: center; - width: 10%; -} - -.uprate { +.state, .downrate, .uprate, .tracker { text-align: center; width: 10%; } diff --git a/templates/index.html b/templates/index.html index f4be317..8e9aa36 100644 --- a/templates/index.html +++ b/templates/index.html @@ -8,10 +8,11 @@
Name | -State | -DL | -UL | +Name | +State | +DL | +UL | +Tracker | {{ torrent.state }} | {{ torrent.downrate_str }} | {{ torrent.uprate_str }} | +{{ torrent.tracker }} | {% endfor %}
---|