mirror of
https://github.com/rembo10/headphones.git
synced 2026-05-16 08:35:32 +01:00
Merge remote-tracking branch 'pabloalcantara/master'
This commit is contained in:
@@ -504,7 +504,7 @@
|
||||
</div>
|
||||
<h2>Re-Encoding Options:</h2>
|
||||
<p>
|
||||
<input class="styled" type="checkbox" name="encode" id="encode" value="1" ${config['encode']} />
|
||||
<input class="styled" type="checkbox" name="music_encoder" id="music_encoder" value="1" ${config['music_encoder']} />
|
||||
Re-encode downloads during postprocessing
|
||||
</p>
|
||||
<div id="encoderoptions">
|
||||
@@ -757,7 +757,7 @@
|
||||
$('#api_key').val(data);
|
||||
});
|
||||
});
|
||||
if ($("#encode").is(":checked"))
|
||||
if ($("#music_encoder").is(":checked"))
|
||||
{
|
||||
$("#encoderoptions").show();
|
||||
}
|
||||
@@ -766,8 +766,8 @@
|
||||
$("#encoderoptions").hide();
|
||||
}
|
||||
|
||||
$("#encode").click(function(){
|
||||
if ($("#encode").is(":checked"))
|
||||
$("#music_encoder").click(function(){
|
||||
if ($("#music_encoder").is(":checked"))
|
||||
{
|
||||
$("#encoderoptions").show("fast");
|
||||
}
|
||||
|
||||
@@ -349,7 +349,7 @@
|
||||
<h2>Re-Encoding Options:</h2>
|
||||
<i class="smalltext">Note: this option requires the lame or ffmpeg encoder</i>
|
||||
<br><br>
|
||||
<h3><input type="checkbox" name="encode" id="encode" value="1" ${config['encode']}/> Re-encode downloads during postprocessing</h3>
|
||||
<h3><input type="checkbox" name="music_encoder" id="music_encoder" value="1" ${config['music_encoder']}/> Re-encode downloads during postprocessing</h3>
|
||||
<br>
|
||||
<div id="encoderoptions">
|
||||
<h4><input type="checkbox" name="encoderlossless" value="1" ${config['encoderlossless']}/> Only re-encode lossless files (.flac)</h4>
|
||||
@@ -580,7 +580,7 @@
|
||||
$('#api_key').val(data);
|
||||
});
|
||||
});
|
||||
if ($("#encode").is(":checked"))
|
||||
if ($("#music_encoder").is(":checked"))
|
||||
{
|
||||
$("#encoderoptions").show();
|
||||
}
|
||||
@@ -589,8 +589,8 @@
|
||||
$("#encoderoptions").hide();
|
||||
}
|
||||
|
||||
$("#encode").click(function(){
|
||||
if ($("#encode").is(":checked"))
|
||||
$("#music_encoder").click(function(){
|
||||
if ($("#music_encoder").is(":checked"))
|
||||
{
|
||||
$("#encoderoptions").show("fast");
|
||||
}
|
||||
|
||||
@@ -327,7 +327,7 @@
|
||||
<legend>Re-Encoding Options</legend>
|
||||
<small class="heading"><span style="float: left; margin-right: .3em; margin-top: 4px;" class="ui-icon ui-icon-info"></span>Note: this option requires the lame or ffmpeg encoder</small>
|
||||
<div class="checkbox row clearfix">
|
||||
<input type="checkbox" name="encode" id="encode" value="1" ${config['encode']}/><label>Re-encode downloads during postprocessing</label>
|
||||
<input type="checkbox" name="music_encoder" id="music_encoder" value="1" ${config['music_encoder']}/><label>Re-encode downloads during postprocessing</label>
|
||||
</div>
|
||||
<div id="encoderoptions" class="row clearfix checkbox">
|
||||
<input type="checkbox" name="encoderlossless" value="1" ${config['encoderlossless']}/><label>Only re-encode lossless files (.flac)</label>
|
||||
@@ -674,7 +674,7 @@
|
||||
$('#api_key').val(data);
|
||||
});
|
||||
});
|
||||
if ($("#encode").is(":checked"))
|
||||
if ($("#music_encoder").is(":checked"))
|
||||
{
|
||||
$("#encoderoptions").show();
|
||||
}
|
||||
@@ -683,8 +683,8 @@
|
||||
$("#encoderoptions").hide();
|
||||
}
|
||||
|
||||
$("#encode").click(function(){
|
||||
if ($("#encode").is(":checked"))
|
||||
$("#music_encoder").click(function(){
|
||||
if ($("#music_encoder").is(":checked"))
|
||||
{
|
||||
$("#encoderoptions").slideDown();
|
||||
}
|
||||
|
||||
@@ -349,7 +349,7 @@
|
||||
<h2>Re-Encoding Options:</h2>
|
||||
<i class="smalltext">Note: this option requires the lame or ffmpeg encoder</i>
|
||||
<br><br>
|
||||
<h3><input type="checkbox" name="encode" id="encode" value="1" ${config['encode']}/> Re-encode downloads during postprocessing</h3>
|
||||
<h3><input type="checkbox" name="music_encoder" id="music_encoder" value="1" ${config['music_encoder']}/> Re-encode downloads during postprocessing</h3>
|
||||
<br>
|
||||
<div id="encoderoptions">
|
||||
<h4><input type="checkbox" name="encoderlossless" value="1" ${config['encoderlossless']}/> Only re-encode lossless files (.flac)</h4>
|
||||
@@ -580,7 +580,7 @@
|
||||
$('#api_key').val(data);
|
||||
});
|
||||
});
|
||||
if ($("#encode").is(":checked"))
|
||||
if ($("#music_encoder").is(":checked"))
|
||||
{
|
||||
$("#encoderoptions").show();
|
||||
}
|
||||
@@ -589,8 +589,8 @@
|
||||
$("#encoderoptions").hide();
|
||||
}
|
||||
|
||||
$("#encode").click(function(){
|
||||
if ($("#encode").is(":checked"))
|
||||
$("#music_encoder").click(function(){
|
||||
if ($("#music_encoder").is(":checked"))
|
||||
{
|
||||
$("#encoderoptions").show("fast");
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ DOWNLOAD_TORRENT_DIR = None
|
||||
INTERFACE = None
|
||||
FOLDER_PERMISSIONS = None
|
||||
|
||||
ENCODE = False
|
||||
MUSIC_ENCODER = False
|
||||
ENCODERFOLDER = None
|
||||
ENCODER = None
|
||||
BITRATE = None
|
||||
@@ -218,7 +218,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, \
|
||||
NZBSORG, NZBSORG_UID, NZBSORG_HASH, NEWZBIN, NEWZBIN_UID, NEWZBIN_PASSWORD, LASTFM_USERNAME, INTERFACE, FOLDER_PERMISSIONS, \
|
||||
ENCODERFOLDER, ENCODER, BITRATE, SAMPLINGFREQUENCY, ENCODE, ADVANCEDENCODER, ENCODEROUTPUTFORMAT, ENCODERQUALITY, ENCODERVBRCBR, \
|
||||
ENCODERFOLDER, ENCODER, BITRATE, SAMPLINGFREQUENCY, MUSIC_ENCODER, ADVANCEDENCODER, ENCODEROUTPUTFORMAT, ENCODERQUALITY, ENCODERVBRCBR, \
|
||||
ENCODERLOSSLESS, 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
|
||||
|
||||
@@ -322,7 +322,7 @@ def initialize():
|
||||
ENCODER = check_setting_str(CFG, 'General', 'encoder', 'ffmpeg')
|
||||
BITRATE = check_setting_int(CFG, 'General', 'bitrate', 192)
|
||||
SAMPLINGFREQUENCY= check_setting_int(CFG, 'General', 'samplingfrequency', 44100)
|
||||
ENCODE = bool(check_setting_int(CFG, 'General', 'encode', 0))
|
||||
MUSIC_ENCODER = bool(check_setting_int(CFG, 'General', 'music_encoder', 0))
|
||||
ADVANCEDENCODER = check_setting_str(CFG, 'General', 'advancedencoder', '')
|
||||
ENCODEROUTPUTFORMAT = check_setting_str(CFG, 'General', 'encoderoutputformat', 'mp3')
|
||||
ENCODERQUALITY = check_setting_int(CFG, 'General', 'encoderquality', 2)
|
||||
@@ -595,7 +595,7 @@ def config_write():
|
||||
new_config['General']['interface'] = INTERFACE
|
||||
new_config['General']['folder_permissions'] = FOLDER_PERMISSIONS
|
||||
|
||||
new_config['General']['encode'] = int(ENCODE)
|
||||
new_config['General']['music_encoder'] = int(MUSIC_ENCODER)
|
||||
new_config['General']['encoder'] = ENCODER
|
||||
new_config['General']['bitrate'] = int(BITRATE)
|
||||
new_config['General']['samplingfrequency'] = int(SAMPLINGFREQUENCY)
|
||||
|
||||
@@ -18,7 +18,7 @@ def encode(albumPath):
|
||||
musicFinalFiles=[]
|
||||
musicTempFiles=[]
|
||||
encoder =""
|
||||
startAlbumTime=time.clock()
|
||||
startAlbumTime=time.time()
|
||||
ifencoded=0
|
||||
|
||||
if not os.path.exists(tempDirEncode):
|
||||
@@ -89,7 +89,7 @@ def encode(albumPath):
|
||||
def command(encoder,musicSource,musicDest,albumPath):
|
||||
return_code=1
|
||||
cmd=''
|
||||
startMusicTime=time.clock()
|
||||
startMusicTime=time.time()
|
||||
if headphones.ENCODER == 'lame':
|
||||
if headphones.ADVANCEDENCODER =='':
|
||||
cmd=encoder + ' -h'
|
||||
@@ -115,7 +115,7 @@ def command(encoder,musicSource,musicDest,albumPath):
|
||||
cmd=cmd+ ' -ar ' + str(headphones.SAMPLINGFREQUENCY) + ' -ab ' + str(headphones.BITRATE) + 'k'
|
||||
elif headphones.ENCODERVBRCBR=='vbr':
|
||||
cmd=cmd+' -aq ' + str(headphones.ENCODERQUALITY)
|
||||
cmd=cmd+ ' -y -ac 2 -map_meta_data 0:0,s0 -vn'
|
||||
cmd=cmd+ ' -y -ac 2 -vn'
|
||||
else:
|
||||
cmd=cmd+' '+ headphones.ADVANCEDENCODER
|
||||
cmd=cmd+ ' "' + musicDest + '"'
|
||||
@@ -128,7 +128,7 @@ def command(encoder,musicSource,musicDest,albumPath):
|
||||
logger.info('Music "%s" encoded in %s' % (musicSource,getTimeEncode(startMusicTime)))
|
||||
|
||||
def getTimeEncode(start):
|
||||
seconds =int(time.clock()-start)
|
||||
seconds =int(time.time()-start)
|
||||
hours = seconds / 3600
|
||||
seconds -= 3600*hours
|
||||
minutes = seconds / 60
|
||||
@@ -1,6 +1,6 @@
|
||||
import os
|
||||
import time
|
||||
import encode
|
||||
import music_encoder
|
||||
import urllib, shutil, re
|
||||
from headphones import notifiers
|
||||
import lib.beets as beets
|
||||
@@ -209,8 +209,8 @@ def doPostProcessing(albumid, albumpath, release, tracks, downloaded_track_list)
|
||||
|
||||
logger.info('Starting post-processing for: %s - %s' % (release['ArtistName'], release['AlbumTitle']))
|
||||
#start enconding
|
||||
if headphones.ENCODE:
|
||||
downloaded_track_list=encode.encode(albumpath)
|
||||
if headphones.MUSIC_ENCODER:
|
||||
downloaded_track_list=music_encoder.encode(albumpath)
|
||||
|
||||
album_art_path = albumart.getAlbumArt(albumid)
|
||||
|
||||
|
||||
@@ -387,7 +387,7 @@ class WebInterface(object):
|
||||
"autowant_all" : checked(headphones.AUTOWANT_ALL),
|
||||
"log_dir" : headphones.LOG_DIR,
|
||||
"interface_list" : interface_list,
|
||||
"encode": checked(headphones.ENCODE),
|
||||
"music_encoder": checked(headphones.MUSIC_ENCODER),
|
||||
"encoder": headphones.ENCODER,
|
||||
"bitrate": int(headphones.BITRATE),
|
||||
"encoderfolder": headphones.ENCODERFOLDER,
|
||||
@@ -428,7 +428,7 @@ class WebInterface(object):
|
||||
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,
|
||||
torrentblackhole_dir=None, download_torrent_dir=None, numberofseeders=10, use_isohunt=0, use_kat=0, use_mininova=0,
|
||||
rename_files=0, correct_metadata=0, cleanup_files=0, add_album_art=0, embed_album_art=0, embed_lyrics=0, destination_dir=None, folder_format=None, file_format=None, include_extras=0, autowant_upcoming=False, autowant_all=False, interface=None, log_dir=None,
|
||||
encode=0, encoder=None, bitrate=None, samplingfrequency=None, encoderfolder=None, advancedencoder=None, encoderoutputformat=None, encodervbrcbr=None, encoderquality=None, encoderlossless=0,
|
||||
music_encoder=0, encoder=None, bitrate=None, samplingfrequency=None, encoderfolder=None, advancedencoder=None, encoderoutputformat=None, encodervbrcbr=None, encoderquality=None, encoderlossless=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, mirror=None, customhost=None, customport=None, customsleep=None, hpuser=None, hppass=None):
|
||||
|
||||
@@ -487,7 +487,7 @@ class WebInterface(object):
|
||||
headphones.AUTOWANT_ALL = autowant_all
|
||||
headphones.INTERFACE = interface
|
||||
headphones.LOG_DIR = log_dir
|
||||
headphones.ENCODE = encode
|
||||
headphones.MUSIC_ENCODER = music_encoder
|
||||
headphones.ENCODER = encoder
|
||||
headphones.BITRATE = int(bitrate)
|
||||
headphones.SAMPLINGFREQUENCY = int(samplingfrequency)
|
||||
|
||||
Reference in New Issue
Block a user