mirror of
https://github.com/AzuraCast/AzuraCast.git
synced 2024-06-15 13:46:37 +00:00
#471 -- Don't overwrite initial station configuration with read() call
This commit is contained in:
parent
a5be2f20c4
commit
d718150ae5
|
@ -141,9 +141,7 @@ class Icecast extends FrontendAbstract
|
|||
public function read()
|
||||
{
|
||||
$config = $this->_getConfig();
|
||||
|
||||
$this->station->setFrontendConfig($this->_loadFromConfig($config));
|
||||
|
||||
$this->station->setFrontendConfigDefaults($this->_loadFromConfig($config));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -102,9 +102,7 @@ class SHOUTcast extends FrontendAbstract
|
|||
public function read()
|
||||
{
|
||||
$config = $this->_getConfig();
|
||||
|
||||
$this->station->setFrontendConfig($this->_loadFromConfig($config));
|
||||
|
||||
$this->station->setFrontendConfigDefaults($this->_loadFromConfig($config));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -327,6 +327,24 @@ class Station
|
|||
$this->frontend_config = $config;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set frontend configuration but do not overwrite existing values.
|
||||
*
|
||||
* @param $default_config
|
||||
*/
|
||||
public function setFrontendConfigDefaults($default_config)
|
||||
{
|
||||
$frontend_config = (array)$this->frontend_config;
|
||||
|
||||
foreach($default_config as $config_key => $config_value) {
|
||||
if (empty($frontend_config[$config_key])) {
|
||||
$frontend_config[$config_key] = $config_value;
|
||||
}
|
||||
}
|
||||
|
||||
$this->frontend_config = $frontend_config;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return null|string
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue
Block a user