From 54f2ba3b3bc0680d65f57191910db543bd3cb162 Mon Sep 17 00:00:00 2001 From: rembo10 Date: Mon, 8 Jul 2013 10:41:10 +0530 Subject: [PATCH] initial changes to get transmission working: added torrent_downloader option (blackhole/transmission), updated config page --- data/interfaces/default/config.html | 57 ++++++++++++++++++++++------- headphones/__init__.py | 7 +++- headphones/webserve.py | 6 ++- 3 files changed, 54 insertions(+), 16 deletions(-) diff --git a/data/interfaces/default/config.html b/data/interfaces/default/config.html index 3e0641a6..5dda08e5 100644 --- a/data/interfaces/default/config.html +++ b/data/interfaces/default/config.html @@ -177,20 +177,32 @@
Torrents -
- - - Folder your Download program watches for Torrents -
+ Black Hole Transmission +
+
+
+ + + Folder your Download program watches for Torrents +
+
+
+
+ + + Transmission Host +
+
+ +
+ + + Number of minimum seeders a torrent must have to be accepted +
- - - Number of minimum seeders a torrent must have to be accepted -
-
- - - Full path where your torrent client downloads your music e.g. /Users/name/Downloads/music + + + Full path where your torrent client downloads your music e.g. /Users/name/Downloads/music
@@ -1054,6 +1066,17 @@ $("#sabnzbd_options,#nzbget_options").hide(); $("#blackhole_options").show(); } + + if ($("#torrent_downloader_blackhole").is(":checked")) + { + $("#transmission_options").hide(); + $("#torrent_blackhole_options").show(); + } + if ($("#torrent_downloader_transmission").is(":checked")) + { + $("#torrent_blackhole_options").hide(); + $("#transmission_options").show(); + } $('input[type=radio]').change(function(){ if ($("#preferred_bitrate").is(":checked")) @@ -1084,6 +1107,14 @@ { $("#sabnzbd_options,#nzbget_options").fadeOut("fast", function() { $("#blackhole_options").fadeIn() }); } + if ($("#torrent_downloader_blackhole").is(":checked")) + { + $("#transmission_options").fadeOut("fast", function() { $("#torrent_blackhole_options").fadeIn() }); + } + if ($("#torrent_downloader_transmission").is(":checked")) + { + $("#torrent_blackhole_options").fadeOut("fast", function() { $("#transmission_options").fadeIn() }); + } }); $("#mirror").change(handleNewServerSelection); diff --git a/headphones/__init__.py b/headphones/__init__.py index 965c5e1b..ab3451b0 100644 --- a/headphones/__init__.py +++ b/headphones/__init__.py @@ -109,7 +109,8 @@ ADD_ALBUM_ART = False ALBUM_ART_FORMAT = None EMBED_ALBUM_ART = False EMBED_LYRICS = False -NZB_DOWNLOADER = None +NZB_DOWNLOADER = None # 0: sabnzbd, 1: nzbget, 2: blackhole +TORRENT_DOWNLOADER = None # 0: blackhole, 1: transmission DOWNLOAD_DIR = None BLACKHOLE = None BLACKHOLE_DIR = None @@ -295,7 +296,7 @@ def initialize(): LIBRARYSCAN, LIBRARYSCAN_INTERVAL, DOWNLOAD_SCAN_INTERVAL, SAB_HOST, SAB_USERNAME, SAB_PASSWORD, SAB_APIKEY, SAB_CATEGORY, \ NZBGET_USERNAME, NZBGET_PASSWORD, NZBGET_CATEGORY, NZBGET_HOST, NZBMATRIX, NZBMATRIX_USERNAME, NZBMATRIX_APIKEY, NEWZNAB, NEWZNAB_HOST, NEWZNAB_APIKEY, NEWZNAB_ENABLED, EXTRA_NEWZNABS, \ NZBSORG, NZBSORG_UID, NZBSORG_HASH, NEWZBIN, NEWZBIN_UID, NEWZBIN_PASSWORD, NZBSRUS, NZBSRUS_UID, NZBSRUS_APIKEY, NZBX, \ - NZB_DOWNLOADER, PREFERRED_WORDS, REQUIRED_WORDS, IGNORED_WORDS, \ + NZB_DOWNLOADER, TORRENT_DOWNLOADER, PREFERRED_WORDS, REQUIRED_WORDS, IGNORED_WORDS, \ LASTFM_USERNAME, INTERFACE, FOLDER_PERMISSIONS, ENCODERFOLDER, ENCODER_PATH, ENCODER, XLDPROFILE, BITRATE, SAMPLINGFREQUENCY, \ MUSIC_ENCODER, ADVANCEDENCODER, ENCODEROUTPUTFORMAT, ENCODERQUALITY, ENCODERVBRCBR, ENCODERLOSSLESS, DELETE_LOSSLESS_FILES, \ PROWL_ENABLED, PROWL_PRIORITY, PROWL_KEYS, PROWL_ONSNATCH, PUSHOVER_ENABLED, PUSHOVER_PRIORITY, PUSHOVER_KEYS, PUSHOVER_ONSNATCH, MIRRORLIST, \ @@ -377,6 +378,7 @@ def initialize(): EMBED_ALBUM_ART = bool(check_setting_int(CFG, 'General', 'embed_album_art', 0)) EMBED_LYRICS = bool(check_setting_int(CFG, 'General', 'embed_lyrics', 0)) NZB_DOWNLOADER = check_setting_int(CFG, 'General', 'nzb_downloader', 0) + TORRENT_DOWNLOADER = check_setting_int(CFG, 'General', 'torrent_downloader', 0) DOWNLOAD_DIR = check_setting_str(CFG, 'General', 'download_dir', '') BLACKHOLE = bool(check_setting_int(CFG, 'General', 'blackhole', 0)) BLACKHOLE_DIR = check_setting_str(CFG, 'General', 'blackhole_dir', '') @@ -721,6 +723,7 @@ def config_write(): new_config['General']['embed_album_art'] = int(EMBED_ALBUM_ART) new_config['General']['embed_lyrics'] = int(EMBED_LYRICS) new_config['General']['nzb_downloader'] = NZB_DOWNLOADER + new_config['General']['torrent_downloader'] = TORRENT_DOWNLOADER new_config['General']['download_dir'] = DOWNLOAD_DIR new_config['General']['blackhole_dir'] = BLACKHOLE_DIR new_config['General']['usenet_retention'] = USENET_RETENTION diff --git a/headphones/webserve.py b/headphones/webserve.py index 1f8167ab..b7519aec 100644 --- a/headphones/webserve.py +++ b/headphones/webserve.py @@ -582,6 +582,8 @@ class WebInterface(object): "nzb_downloader_sabnzbd" : radio(headphones.NZB_DOWNLOADER, 0), "nzb_downloader_nzbget" : radio(headphones.NZB_DOWNLOADER, 1), "nzb_downloader_blackhole" : radio(headphones.NZB_DOWNLOADER, 2), + "torrent_downloader_blackhole" : radio(headphones.TORRENT_DOWNLOADER, 0), + "torrent_downloader_transmission" : radio(headphones.TORRENT_DOWNLOADER, 1), "download_dir" : headphones.DOWNLOAD_DIR, "use_blackhole" : checked(headphones.BLACKHOLE), "blackhole_dir" : headphones.BLACKHOLE_DIR, @@ -705,7 +707,8 @@ class WebInterface(object): def configUpdate(self, http_host='0.0.0.0', http_username=None, http_port=8181, http_password=None, launch_browser=0, api_enabled=0, api_key=None, download_scan_interval=None, nzb_search_interval=None, libraryscan_interval=None, sab_host=None, sab_username=None, sab_apikey=None, sab_password=None, - sab_category=None, nzbget_host=None, nzbget_username='nzbget', nzbget_password=None, nzbget_category=None, nzb_downloader=0, download_dir=None, blackhole=0, blackhole_dir=None, usenet_retention=None, newznab=0, newznab_host=None, newznab_apikey=None, + sab_category=None, nzbget_host=None, nzbget_username='nzbget', nzbget_password=None, nzbget_category=None, nzb_downloader=0, torrent_downloader=0, + download_dir=None, blackhole=0, blackhole_dir=None, usenet_retention=None, newznab=0, newznab_host=None, newznab_apikey=None, newznab_enabled=0, nzbsorg=0, nzbsorg_uid=None, nzbsorg_hash=None, nzbsrus=0, nzbsrus_uid=None, nzbsrus_apikey=None, nzbx=0, preferred_words=None, required_words=None, ignored_words=None, preferred_quality=0, preferred_bitrate=None, detect_bitrate=0, move_files=0, torrentblackhole_dir=None, download_torrent_dir=None, numberofseeders=10, use_isohunt=0, use_kat=0, use_mininova=0, waffles=0, waffles_uid=None, waffles_passkey=None, whatcd=0, whatcd_username=None, whatcd_password=None, @@ -738,6 +741,7 @@ class WebInterface(object): headphones.NZBGET_PASSWORD = nzbget_password headphones.NZBGET_CATEGORY = nzbget_category headphones.NZB_DOWNLOADER = int(nzb_downloader) + headphones.TORRENT_DOWNLOADER = int(torrent_downloader) headphones.DOWNLOAD_DIR = download_dir headphones.BLACKHOLE = blackhole headphones.BLACKHOLE_DIR = blackhole_dir