Merge branch 'devel' of dev.sourcefabric.org:airtime into devel

This commit is contained in:
denise 2013-01-03 16:19:20 -05:00
commit c11032111e
4 changed files with 23 additions and 21 deletions

View File

@ -80,7 +80,7 @@
<?php endforeach; ?>
</ul>
<?php endif; ?>
<div id="slider-range-max"></div>
<div id="slider-range-max" style="width: 99%"></div>
</dd>
</dl>
</fieldset>

View File

@ -231,7 +231,7 @@ function setupEventListeners() {
}
})
$('.toggle legend').live('click',function() {
$('.toggle legend').click(function() {
$(this).parent().toggleClass('closed');
return false;
});
@ -375,21 +375,6 @@ function setupEventListeners() {
at: "right center"
},
})
$('#stream_save').live('click', function(){
var confirm_pypo_restart_text = $.i18n._("If you change the username or password values for an enabled stream the playout engine will be rebooted and your listeners will hear silence for 5-10 seconds. Changing the following fields will NOT cause a reboot: Stream Label (Global Settings), and Switch Transition Fade(s), Master Username, and Master Password (Input Stream Settings). If Airtime is recording, and if the change causes a playout engine restart, the recording will be interrupted.");
if (confirm(confirm_pypo_restart_text)) {
var data = $('#stream_form').serialize();
var url = baseUrl+'/Preference/stream-setting';
$.post(url, {format:"json", data: data}, function(data){
var json = $.parseJSON(data);
$('#content').empty().append(json.html);
setupEventListeners();
setSliderForReplayGain();
});
}
});
}
function setSliderForReplayGain(){
@ -409,5 +394,20 @@ function setSliderForReplayGain(){
$(document).ready(function() {
setupEventListeners();
setSliderForReplayGain();
$('#stream_save').live('click', function(){
var confirm_pypo_restart_text = $.i18n._("If you change the username or password values for an enabled stream the playout engine will be rebooted and your listeners will hear silence for 5-10 seconds. Changing the following fields will NOT cause a reboot: Stream Label (Global Settings), and Switch Transition Fade(s), Master Username, and Master Password (Input Stream Settings). If Airtime is recording, and if the change causes a playout engine restart, the recording will be interrupted.");
if (confirm(confirm_pypo_restart_text)) {
var data = $('#stream_form').serialize();
var url = baseUrl+'/Preference/stream-setting';
$.post(url, {format:"json", data: data}, function(data){
var json = $.parseJSON(data);
$('#content').empty().append(json.html);
setupEventListeners();
setSliderForReplayGain();
});
}
});
});

View File

@ -9,6 +9,7 @@ from collections import namedtuple
import mutagen
import subprocess
import json
import logging
class FakeMutagen(dict):
"""
@ -168,7 +169,7 @@ def normalize_mutagen(path):
md['sample_rate'] = getattr(m.info, 'sample_rate', 0)
md['mime'] = m.mime[0] if len(m.mime) > 0 else u''
md['path'] = normpath(path)
# silence detect(set default queue in and out)
try:
command = ['silan', '-f', 'JSON', md['path']]
@ -178,8 +179,9 @@ def normalize_mutagen(path):
md['cuein'] = info['sound'][0][0]
md['cueout'] = info['sound'][-1][1]
except Exception:
raise
logger = logging.getLogger()
logger.info('silan is missing')
if 'title' not in md: md['title'] = u''
return md

View File

@ -296,7 +296,7 @@ class PypoFetch(Thread):
dump, stream = s[u'keyname'].split('_', 1)
state_change_restart[stream] = False
# This is the case where restart is required no matter what
if (existing[s[u'keyname']] != s[u'value']):
if (existing[s[u'keyname']] != str(s[u'value'])):
self.logger.info("'Need-to-restart' state detected for %s...", s[u'keyname'])
restart = True;
elif "master_live_stream_port" in s[u'keyname'] or "master_live_stream_mp" in s[u'keyname'] or "dj_live_stream_port" in s[u'keyname'] or "dj_live_stream_mp" in s[u'keyname']: