From a55f60768854efe412b66d9653203f91ecef1638 Mon Sep 17 00:00:00 2001 From: rembo10 Date: Tue, 9 Jul 2013 19:13:43 +0530 Subject: [PATCH] Add utorrent support while we're at it (initial changes) --- data/interfaces/default/config.html | 27 +++++++++++++++++++++------ headphones/__init__.py | 2 +- headphones/webserve.py | 1 + 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/data/interfaces/default/config.html b/data/interfaces/default/config.html index 5dda08e5..94037a0a 100644 --- a/data/interfaces/default/config.html +++ b/data/interfaces/default/config.html @@ -177,7 +177,7 @@
Torrents - Black Hole Transmission + Black Hole Transmission uTorrent
@@ -193,7 +193,13 @@ Transmission Host
- +
+
+ + + Utorrent Host +
+
@@ -1069,14 +1075,19 @@ if ($("#torrent_downloader_blackhole").is(":checked")) { - $("#transmission_options").hide(); + $("#transmission_options,#utorrent_options").hide(); $("#torrent_blackhole_options").show(); } if ($("#torrent_downloader_transmission").is(":checked")) { - $("#torrent_blackhole_options").hide(); + $("#torrent_blackhole_options,#utorrent_options").hide(); $("#transmission_options").show(); } + if ($("#torrent_downloader_utorrent").is(":checked")) + { + $("#torrent_blackhole_options,#transmission_options").hide(); + $("#utorrent_options").show(); + } $('input[type=radio]').change(function(){ if ($("#preferred_bitrate").is(":checked")) @@ -1109,11 +1120,15 @@ } if ($("#torrent_downloader_blackhole").is(":checked")) { - $("#transmission_options").fadeOut("fast", function() { $("#torrent_blackhole_options").fadeIn() }); + $("#transmission_options,#utorrent_options").fadeOut("fast", function() { $("#torrent_blackhole_options").fadeIn() }); } if ($("#torrent_downloader_transmission").is(":checked")) { - $("#torrent_blackhole_options").fadeOut("fast", function() { $("#transmission_options").fadeIn() }); + $("#torrent_blackhole_options,#utorrent_options").fadeOut("fast", function() { $("#transmission_options").fadeIn() }); + } + if ($("#torrent_downloader_utorrent").is(":checked")) + { + $("#torrent_blackhole_options,#transmission_options").fadeOut("fast", function() { $("#utorrent_options").fadeIn() }); } }); diff --git a/headphones/__init__.py b/headphones/__init__.py index ab3451b0..e28ecfbb 100644 --- a/headphones/__init__.py +++ b/headphones/__init__.py @@ -110,7 +110,7 @@ ALBUM_ART_FORMAT = None EMBED_ALBUM_ART = False EMBED_LYRICS = False NZB_DOWNLOADER = None # 0: sabnzbd, 1: nzbget, 2: blackhole -TORRENT_DOWNLOADER = None # 0: blackhole, 1: transmission +TORRENT_DOWNLOADER = None # 0: blackhole, 1: transmission, 2: utorrent DOWNLOAD_DIR = None BLACKHOLE = None BLACKHOLE_DIR = None diff --git a/headphones/webserve.py b/headphones/webserve.py index b7519aec..082c73bd 100644 --- a/headphones/webserve.py +++ b/headphones/webserve.py @@ -584,6 +584,7 @@ class WebInterface(object): "nzb_downloader_blackhole" : radio(headphones.NZB_DOWNLOADER, 2), "torrent_downloader_blackhole" : radio(headphones.TORRENT_DOWNLOADER, 0), "torrent_downloader_transmission" : radio(headphones.TORRENT_DOWNLOADER, 1), + "torrent_downloader_utorrent" : radio(headphones.TORRENT_DOWNLOADER, 2), "download_dir" : headphones.DOWNLOAD_DIR, "use_blackhole" : checked(headphones.BLACKHOLE), "blackhole_dir" : headphones.BLACKHOLE_DIR,