CC-2661: Uptrade script for stream config feature

- codes for conserving user's liquidsoap.cfg and porting into new stream
setting config.
- extra fix: fixed a bug with shoutcast(default value has to be set for
some variables)
This commit is contained in:
James 2011-09-01 16:02:06 -04:00
parent 17e7e9b80a
commit 39b688c256
11 changed files with 125 additions and 26 deletions

View file

@ -18,7 +18,7 @@ class Application_Form_StreamSetting extends Zend_Form
$output_sound_device = new Zend_Form_Element_Checkbox('output_sound_device');
$output_sound_device->setLabel('Enabled')
->setRequired(false)
->setValue($setting['output_sound_device'])
->setValue(($setting['output_sound_device'] == "true")?1:0)
->setDecorators(array('ViewHelper'));
$this->addElement($output_sound_device);
}

View file

@ -99,13 +99,9 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm{
->setDecorators(array('ViewHelper'));
$this->addElement($description);
$mount_info = array();
if(isset($setting[$prefix.'_mount'])){
$mount_info = explode('.',$setting[$prefix.'_mount']);
}
$mount = new Zend_Form_Element_Text('mount');
$mount->setLabel("Mount Point")
->setValue(isset($mount_info[0])?$mount_info[0]:"")
->setValue(isset($setting[$prefix.'_mount'])?$setting[$prefix.'_mount']:"")
->setDecorators(array('ViewHelper'));
$this->addElement($mount);

View file

@ -30,6 +30,7 @@ class Application_Model_StreamSetting {
$v = 'disabled';
}
}
$v = trim($v);
$sql = "UPDATE cc_stream_setting SET value='$v' WHERE keyname='$keyname'";
$CC_DBC->query($sql);
}

View file

@ -7,6 +7,7 @@ INSERT INTO cc_pref("keystr", "valstr") VALUES('num_of_streams', '3');
INSERT INTO cc_pref("keystr", "valstr") VALUES('max_bitrate', '320');
INSERT INTO cc_stream_setting ("keyname", "value", "type") VALUES ('output_sound_device', 'false', 'boolean');
INSERT INTO cc_stream_setting ("keyname", "value", "type") VALUES ('icecast_vorbis_metadata', 'false', 'boolean');
INSERT INTO cc_stream_setting ("keyname", "value", "type") VALUES ('s1_output', 'icecast', 'string');
INSERT INTO cc_stream_setting ("keyname", "value", "type") VALUES ('s1_type', 'ogg', 'string');