diff --git a/data/interfaces/default/config.html b/data/interfaces/default/config.html index 532e02f2..508750e4 100644 --- a/data/interfaces/default/config.html +++ b/data/interfaces/default/config.html @@ -417,7 +417,7 @@
Re-Encoding Options - Note: this option requires the lame or ffmpeg encoder + Note: this option requires the lame, ffmpeg or xld encoder
@@ -434,35 +434,42 @@ if config['encoder'] == 'lame': lameselect = 'selected="selected"' ffmpegselect = '' - else: + xldselect = '' + elif config['encoder'] == 'ffmpeg': lameselect = '' ffmpegselect = 'selected="selected"' + xldselect = '' + else: + lameselect = '' + ffmpegselect = '' + xldselect = 'selected="selected"' %>
- +
-
- - -
- +
Audio Properties +
+ + +
+
@@ -760,7 +772,12 @@ $("#hpserveroptions").slideUp(); }; - handleNewSelection = function () { + hideEncoderDivs = function () { + $("#lameffmpegproperties").slideUp(); + $("#xldproperties").slideUp(); + }; + + handleNewServerSelection = function () { hideServerDivs(); @@ -774,6 +791,23 @@ } }; + handleNewEncoderSelection = function () { + + hideEncoderDivs(); + + switch ($(this).val()) { + case 'xld': + $("#xldproperties").slideDown(); + break; + case 'ffmpeg': + $("#lameffmpegproperties").slideDown(); + break; + case 'lame': + $("#lameffmpegproperties").slideDown(); + break; + } + }; + function openExtrasDialog() { $("#dialog").dialog({ close: function(){ var elem = ''; @@ -914,8 +948,11 @@ } }); - $("#mirror").change(handleNewSelection); - handleNewSelection.apply($("#mirror")); + $("#mirror").change(handleNewServerSelection); + handleNewServerSelection.apply($("#mirror")); + + $("#encoder").change(handleNewEncoderSelection); + handleNewEncoderSelection.apply($("#encoder")); var deletedNewznabs = 0; diff --git a/headphones/__init__.py b/headphones/__init__.py index 30fa5902..ec6f5ac4 100644 --- a/headphones/__init__.py +++ b/headphones/__init__.py @@ -168,6 +168,7 @@ FOLDER_PERMISSIONS = None MUSIC_ENCODER = False ENCODERFOLDER = None ENCODER = None +XLDPROFILE = None BITRATE = None SAMPLINGFREQUENCY = None ADVANCEDENCODER = None @@ -261,7 +262,7 @@ def initialize(): LIBRARYSCAN_INTERVAL, DOWNLOAD_SCAN_INTERVAL, SAB_HOST, SAB_USERNAME, SAB_PASSWORD, SAB_APIKEY, SAB_CATEGORY, \ NZBMATRIX, NZBMATRIX_USERNAME, NZBMATRIX_APIKEY, NEWZNAB, NEWZNAB_HOST, NEWZNAB_APIKEY, NEWZNAB_ENABLED, EXTRA_NEWZNABS,\ NZBSORG, NZBSORG_UID, NZBSORG_HASH, NEWZBIN, NEWZBIN_UID, NEWZBIN_PASSWORD, LASTFM_USERNAME, INTERFACE, FOLDER_PERMISSIONS, \ - ENCODERFOLDER, ENCODER, BITRATE, SAMPLINGFREQUENCY, MUSIC_ENCODER, ADVANCEDENCODER, ENCODEROUTPUTFORMAT, ENCODERQUALITY, \ + ENCODERFOLDER, ENCODER, XLDPROFILE, BITRATE, SAMPLINGFREQUENCY, MUSIC_ENCODER, ADVANCEDENCODER, ENCODEROUTPUTFORMAT, ENCODERQUALITY, \ ENCODERVBRCBR, ENCODERLOSSLESS, DELETE_LOSSLESS_FILES, PROWL_ENABLED, PROWL_PRIORITY, PROWL_KEYS, PROWL_ONSNATCH, MIRRORLIST, \ MIRROR, CUSTOMHOST, CUSTOMPORT, CUSTOMSLEEP, HPUSER, HPPASS, XBMC_ENABLED, XBMC_HOST, XBMC_USERNAME, XBMC_PASSWORD, XBMC_UPDATE, \ XBMC_NOTIFY, NMA_ENABLED, NMA_APIKEY, NMA_PRIORITY, NMA_ONSNATCH, SYNOINDEX_ENABLED, ALBUM_COMPLETION_PCT, PREFERRED_BITRATE_HIGH_BUFFER, \ @@ -397,6 +398,7 @@ def initialize(): ENCODERFOLDER = check_setting_str(CFG, 'General', 'encoderfolder', '') ENCODER = check_setting_str(CFG, 'General', 'encoder', 'ffmpeg') + XLDPROFILE = check_setting_str(CFG, 'General', 'xldprofile', '') BITRATE = check_setting_int(CFG, 'General', 'bitrate', 192) SAMPLINGFREQUENCY= check_setting_int(CFG, 'General', 'samplingfrequency', 44100) MUSIC_ENCODER = bool(check_setting_int(CFG, 'General', 'music_encoder', 0)) @@ -723,6 +725,7 @@ def config_write(): new_config['General']['music_encoder'] = int(MUSIC_ENCODER) new_config['General']['encoder'] = ENCODER + new_config['General']['xldprofile'] = XLDPROFILE new_config['General']['bitrate'] = int(BITRATE) new_config['General']['samplingfrequency'] = int(SAMPLINGFREQUENCY) new_config['General']['encoderfolder'] = ENCODERFOLDER diff --git a/headphones/music_encoder.py b/headphones/music_encoder.py index 8a66228e..4e057e20 100644 --- a/headphones/music_encoder.py +++ b/headphones/music_encoder.py @@ -29,8 +29,7 @@ except ImportError: # xld -if headphones.ADVANCEDENCODER.lower().startswith('xld'): - XLDPROFILE = headphones.ADVANCEDENCODER[4:] +if headphones.ENCODER == 'xld': import getXldProfile XLD = True else: @@ -42,7 +41,7 @@ def encode(albumPath): if XLD: global xldProfile - (xldProfile, xldFormat, xldBitrate) = getXldProfile.getXldProfile(XLDPROFILE) + (xldProfile, xldFormat, xldBitrate) = getXldProfile.getXldProfile(headphones.XLDPROFILE) if not xldFormat: logger.error(u'Details for xld profile "%s" not found, will not be reencoded' % (xldProfile)) return None diff --git a/headphones/webserve.py b/headphones/webserve.py index bac8b3cf..a8dd11ae 100644 --- a/headphones/webserve.py +++ b/headphones/webserve.py @@ -623,6 +623,7 @@ class WebInterface(object): "interface_list" : interface_list, "music_encoder": checked(headphones.MUSIC_ENCODER), "encoder": headphones.ENCODER, + "xldprofile": headphones.XLDPROFILE, "bitrate": int(headphones.BITRATE), "encoderfolder": headphones.ENCODERFOLDER, "advancedencoder": headphones.ADVANCEDENCODER, @@ -683,8 +684,8 @@ class WebInterface(object): 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, rutracker=0, rutracker_user=None, rutracker_password=None, rename_files=0, correct_metadata=0, cleanup_files=0, add_album_art=0, embed_album_art=0, embed_lyrics=0, destination_dir=None, lossless_destination_dir=None, folder_format=None, file_format=None, include_extras=0, single=0, ep=0, compilation=0, soundtrack=0, live=0, - remix=0, spokenword=0, audiobook=0, autowant_upcoming=False, autowant_all=False, interface=None, log_dir=None, cache_dir=None, music_encoder=0, encoder=None, bitrate=None, - samplingfrequency=None, encoderfolder=None, advancedencoder=None, encoderoutputformat=None, encodervbrcbr=None, encoderquality=None, encoderlossless=0, + remix=0, spokenword=0, audiobook=0, autowant_upcoming=False, autowant_all=False, interface=None, log_dir=None, cache_dir=None, music_encoder=0, encoder=None, xldprofile=None, + bitrate=None, samplingfrequency=None, encoderfolder=None, advancedencoder=None, encoderoutputformat=None, encodervbrcbr=None, encoderquality=None, encoderlossless=0, delete_lossless_files=0, prowl_enabled=0, prowl_onsnatch=0, prowl_keys=None, prowl_priority=0, xbmc_enabled=0, xbmc_host=None, xbmc_username=None, xbmc_password=None, xbmc_update=0, xbmc_notify=0, nma_enabled=False, nma_apikey=None, nma_priority=0, nma_onsnatch=0, synoindex_enabled=False, mirror=None, customhost=None, customport=None, customsleep=None, hpuser=None, hppass=None, preferred_bitrate_high_buffer=None, preferred_bitrate_low_buffer=None, cache_sizemb=0, **kwargs): @@ -760,6 +761,7 @@ class WebInterface(object): headphones.CACHE_DIR = cache_dir headphones.MUSIC_ENCODER = music_encoder headphones.ENCODER = encoder + headphones.XLDPROFILE = xldprofile headphones.BITRATE = int(bitrate) headphones.SAMPLINGFREQUENCY = int(samplingfrequency) headphones.ENCODERFOLDER = encoderfolder