"Fix" ShoutCast legacy streaming information. It's still mostly terrible, but it works!

This commit is contained in:
Buster Silver 2016-09-01 23:53:50 -05:00
parent fc9f6d041b
commit 2eab783acc
2 changed files with 32 additions and 7 deletions

View File

@ -130,9 +130,26 @@ class IceCast extends AdapterAbstract
],
);
$config['listen-socket']['port'] = $frontend_config['port'];
$config['authentication']['source-password'] = $frontend_config['source_pw'];
$config['authentication']['admin-password'] = $frontend_config['admin_pw'];
if (!empty($frontend_config['port']))
$config['listen-socket']['port'] = $frontend_config['port'];
if (!empty($frontend_config['source_pw']))
$config['authentication']['source-password'] = $frontend_config['source_pw'];
if (!empty($frontend_config['admin_pw']))
$config['authentication']['admin-password'] = $frontend_config['admin_pw'];
if (!empty($frontend_config['streamer_pw']))
$config['mount'][0]['password'] = $frontend_config['streamer_pw'];
// Set any unset values back to the DB config.
$frontend_config['port'] = $config['listen-socket']['port'];
$frontend_config['source_pw'] = $config['authentication']['source-password'];
$frontend_config['admin_pw'] = $config['authentication']['admin-password'];
$frontend_config['streamer_pw'] = $config['mount'][0]['password'];
$this->station->frontend_config = $frontend_config;
$this->station->save();
$config_path = $this->station->getRadioConfigDir();
$icecast_path = $config_path.'/icecast.xml';
@ -244,16 +261,21 @@ class IceCast extends AdapterAbstract
'admin-password' => Utilities::generatePassword(),
],
'hostname' => 'localhost',
'listen-socket' => [
'port' => 8000,
'shoutcast-mount' => '/radio.mp3',
],
'shoutcast-mount' => '/radio.mp3',
'mount' => [
[
'@type' => 'normal',
'mount-name' => '/radio.mp3',
'fallback-mount' => '/autodj.mp3',
'fallback-override' => 1,
'username' => 'shoutcast',
'password' => Utilities::generatePassword(),
],
[
'@type' => 'normal',

View File

@ -84,7 +84,7 @@ $manual = true;
<dd>/radio.mp3</dd>
</dl>
<h4>ShoutCast Clients</h4>
<h4>ShoutCast 1.x Legacy Clients</h4>
<dl>
<dt>Server:</dt>
<dd><?=$server_url ?></dd>
@ -92,8 +92,11 @@ $manual = true;
<dt>Port:</dt>
<dd><?=(int)$frontend_info['port']+1 ?></dd>
<dt>Password Format:</dt>
<dd>djusername:djpassword</dd>
<dt>Username:</dt>
<dd>(Leave blank)</dd>
<dt>Password:</dt>
<dd><?=$frontend_info['streamer_pw'] ?></dd>
</dl>
<?
endif;