Added reencoding options to GUI

This commit is contained in:
Remy
2011-08-17 00:14:28 -07:00
parent cb69493b9e
commit 0197892057
3 changed files with 29 additions and 12 deletions

View File

@@ -260,16 +260,24 @@
<td>
<h2>Re-Encoding Options:</h2>
<br>
<h3><input type="checkbox" name="reencode" value="1" />Convert Lossless to mp3</h3>
<h3><input type="checkbox" name="encode" value="1" ${config['encode']}/>Convert Lossless to mp3</h3>
<i class="smalltext">Note: this option requires the lame or ffdshow encoder</i>
<br><br>
<%
if config['encoder'] == 'lame':
lameselect = 'selected="selected"'
ffdshowselect = ''
else:
lameselect = ''
ffdshowselect = 'selected="selected"'
%>
<h3>Encoder: <select name="encoder">
<option value="lame">lame</option>
<option value="ffdshow">ffdshow</option>
<option value="lame" ${lameselect}>lame</option>
<option value="ffdshow" ${ffdshowselect}>ffdshow</option>
</select>
Bitrate: <input type="text" name="encode_bitrate" value="" size="3" maxlength="5" />kbps <br>
Bitrate: <input type="text" name="bitrate" value="${config['bitrate']}" size="3" maxlength="5" />kbps <br>
<br>
<h3>Path to Encoder:</h3><input type="text" name="encoder" value="" size="43">
<h3>Path to Encoder:</h3><input type="text" name="encoder" value="{config['encoderfolder']}" size="43">
</td>
</tr>
</table>

View File

@@ -109,7 +109,7 @@ MEDIA_FORMATS = ["mp3", "flac", "aac", "ogg", "ape", "m4a"]
INTERFACE = None
FOLDER_PERMISSIONS = None
ENCODE = None
ENCODE = False
ENCODERFOLDER = None
ENCODER = None
BITRATE = None
@@ -256,9 +256,9 @@ def initialize():
ENCODERFOLDER = check_setting_str(CFG, 'General', 'encoderfolder', '')
ENCODER = check_setting_str(CFG, 'General', 'encoder', 'ffmpeg')
BITRATE = check_setting_str(CFG, 'General', 'bitrate', '128')
SAMPLINGFREQUENCY= check_setting_str(CFG, 'General', 'samplingfrequency', '44100')
ENCODE = check_setting_str(CFG, 'General', 'encode', 'false')
BITRATE = check_setting_int(CFG, 'General', 'bitrate', 128)
SAMPLINGFREQUENCY= check_setting_int(CFG, 'General', 'samplingfrequency', 44100)
ENCODE = bool(check_setting_int(CFG, 'General', 'encode', 0))
@@ -431,7 +431,7 @@ def config_write():
new_config['General']['interface'] = INTERFACE
new_config['General']['folder_permissions'] = FOLDER_PERMISSIONS
new_config['General']['encode'] = ENCODE
new_config['General']['encode'] = int(ENCODE)
new_config['General']['encoder'] = ENCODER
new_config['General']['bitrate'] = BITRATE
new_config['General']['samplingfrequency'] = SAMPLINGFREQUENCY

View File

@@ -349,7 +349,11 @@ class WebInterface(object):
"file_format" : headphones.FILE_FORMAT,
"include_extras" : checked(headphones.INCLUDE_EXTRAS),
"log_dir" : headphones.LOG_DIR,
"interface_list" : interface_list
"interface_list" : interface_list,
"encode": checked(headphones.ENCODE),
"encoder": headphones.ENCODER,
"bitrate": headphones.BITRATE,
"encoderfolder": headphones.ENCODERFOLDER
}
return serve_template(templatename="config.html", title="Settings", config=config)
config.exposed = True
@@ -359,7 +363,8 @@ class WebInterface(object):
sab_host=None, sab_username=None, sab_apikey=None, sab_password=None, sab_category=None, download_dir=None, blackhole=0, blackhole_dir=None,
usenet_retention=None, nzbmatrix=0, nzbmatrix_username=None, nzbmatrix_apikey=None, newznab=0, newznab_host=None, newznab_apikey=None,
nzbsorg=0, nzbsorg_uid=None, nzbsorg_hash=None, newzbin=0, newzbin_uid=None, newzbin_password=None, preferred_quality=0, preferred_bitrate=None, detect_bitrate=0, move_files=0,
rename_files=0, correct_metadata=0, cleanup_files=0, add_album_art=0, embed_album_art=0, destination_dir=None, folder_format=None, file_format=None, include_extras=0, interface=None, log_dir=None):
rename_files=0, correct_metadata=0, cleanup_files=0, add_album_art=0, embed_album_art=0, destination_dir=None, folder_format=None, file_format=None, include_extras=0, interface=None, log_dir=None,
encode=0, encoder=None, bitrate=None, encoderfolder=None):
headphones.HTTP_HOST = http_host
headphones.HTTP_PORT = http_port
@@ -402,6 +407,10 @@ class WebInterface(object):
headphones.INCLUDE_EXTRAS = include_extras
headphones.INTERFACE = interface
headphones.LOG_DIR = log_dir
headphones.ENCODE = encode
headphones.ENCODER = encoder
headphones.BITRATE = bitrate
headphones.ENCODERFOLDER = encoderfolder
headphones.config_write()