Feature/custom stream url (#631)
This commit is contained in:
parent
175b269dd2
commit
a70e642043
|
@ -97,6 +97,14 @@ return [
|
|||
]
|
||||
],
|
||||
|
||||
'custom_listen_url' => [
|
||||
'text',
|
||||
[
|
||||
'label' => __('Advanced: Custom Stream URL'),
|
||||
'description' => __('You can set a custom URL for this stream that AzuraCast will use when referring to it. Leave empty to use the default value.')
|
||||
]
|
||||
],
|
||||
|
||||
'frontend_config' => [
|
||||
'textarea',
|
||||
[
|
||||
|
@ -123,4 +131,4 @@ return [
|
|||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
];
|
||||
|
|
|
@ -86,6 +86,14 @@ return [
|
|||
]
|
||||
],
|
||||
|
||||
'custom_listen_url' => [
|
||||
'text',
|
||||
[
|
||||
'label' => __('Advanced: Custom Stream URL'),
|
||||
'description' => __('You can set a custom URL for this stream that AzuraCast will use when referring to it. Leave empty to use the default value.')
|
||||
]
|
||||
],
|
||||
|
||||
'authhash' => [
|
||||
'text',
|
||||
[
|
||||
|
@ -114,4 +122,4 @@ return [
|
|||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
];
|
||||
|
|
|
@ -7,8 +7,8 @@ msgstr ""
|
|||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"POT-Creation-Date: 2018-06-24T20:19:16+00:00\n"
|
||||
"PO-Revision-Date: 2018-06-24T20:19:16+00:00\n"
|
||||
"POT-Creation-Date: 2018-06-27T21:31:24+00:00\n"
|
||||
"PO-Revision-Date: 2018-06-27T21:31:24+00:00\n"
|
||||
"Language: \n"
|
||||
|
||||
#: /var/azuracast/www/app/config/admin/actions.conf.php:4
|
||||
|
@ -167,9 +167,9 @@ msgstr ""
|
|||
#: /var/azuracast/www/app/config/forms/branding.conf.php:100
|
||||
#: /var/azuracast/www/app/config/forms/custom_field.conf.php:27
|
||||
#: /var/azuracast/www/app/config/forms/media.conf.php:135
|
||||
#: /var/azuracast/www/app/config/forms/mount/icecast.conf.php:118
|
||||
#: /var/azuracast/www/app/config/forms/mount/icecast.conf.php:126
|
||||
#: /var/azuracast/www/app/config/forms/mount/remote.conf.php:118
|
||||
#: /var/azuracast/www/app/config/forms/mount/shoutcast2.conf.php:109
|
||||
#: /var/azuracast/www/app/config/forms/mount/shoutcast2.conf.php:117
|
||||
#: /var/azuracast/www/app/config/forms/playlist.conf.php:337
|
||||
#: /var/azuracast/www/app/config/forms/profile.conf.php:119
|
||||
#: /var/azuracast/www/app/config/forms/rename.conf.php:18
|
||||
|
@ -582,10 +582,20 @@ msgid "Set to \"yes\" to advertise this stream on the YP public radio directorie
|
|||
msgstr ""
|
||||
|
||||
#: /var/azuracast/www/app/config/forms/mount/icecast.conf.php:103
|
||||
msgid "Advanced Frontend Configuration"
|
||||
#: /var/azuracast/www/app/config/forms/mount/shoutcast2.conf.php:92
|
||||
msgid "Advanced: Custom Stream URL"
|
||||
msgstr ""
|
||||
|
||||
#: /var/azuracast/www/app/config/forms/mount/icecast.conf.php:104
|
||||
#: /var/azuracast/www/app/config/forms/mount/shoutcast2.conf.php:93
|
||||
msgid "You can set a custom URL for this stream that AzuraCast will use when referring to it. Leave empty to use the default value."
|
||||
msgstr ""
|
||||
|
||||
#: /var/azuracast/www/app/config/forms/mount/icecast.conf.php:111
|
||||
msgid "Advanced Frontend Configuration"
|
||||
msgstr ""
|
||||
|
||||
#: /var/azuracast/www/app/config/forms/mount/icecast.conf.php:112
|
||||
msgid "You can include any special mount point settings here, in either JSON { key: 'value' } format or XML <key>value</key>"
|
||||
msgstr ""
|
||||
|
||||
|
@ -630,11 +640,11 @@ msgstr ""
|
|||
msgid "If you are broadcasting using AutoDJ, enter the source password here."
|
||||
msgstr ""
|
||||
|
||||
#: /var/azuracast/www/app/config/forms/mount/shoutcast2.conf.php:92
|
||||
#: /var/azuracast/www/app/config/forms/mount/shoutcast2.conf.php:100
|
||||
msgid "YP Directory Authorization Hash"
|
||||
msgstr ""
|
||||
|
||||
#: /var/azuracast/www/app/config/forms/mount/shoutcast2.conf.php:93
|
||||
#: /var/azuracast/www/app/config/forms/mount/shoutcast2.conf.php:101
|
||||
msgid "If your stream is set to advertise to YP directories above, you must specify an authorization hash. You can manage authhashes <a href=\"%s\" target=\"_blank\">on the SHOUTcast web site</a>."
|
||||
msgstr ""
|
||||
|
||||
|
|
|
@ -127,9 +127,11 @@ abstract class FrontendAbstract extends \AzuraCast\Radio\AdapterAbstract
|
|||
|
||||
public function getUrlForMount($mount)
|
||||
{
|
||||
return ($mount instanceof \Entity\StationMount)
|
||||
? $this->getPublicUrl() . $mount->getName() . '?' . time()
|
||||
: null;
|
||||
if(!$mount instanceof \Entity\StationMount) return null;
|
||||
return (!empty($mount->getCustomListenUrl())
|
||||
? $mount->getCustomListenUrl()
|
||||
: $this->getPublicUrl() . $mount->getName()
|
||||
) . '?' . time();
|
||||
}
|
||||
|
||||
abstract public function getAdminUrl();
|
||||
|
@ -346,4 +348,4 @@ abstract class FrontendAbstract extends \AzuraCast\Radio\AdapterAbstract
|
|||
{
|
||||
return (8000 + (($this->station->getId() - 1) * 10));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace Entity\Migration;
|
||||
|
||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
|
||||
/**
|
||||
* Based to Version20180506022642
|
||||
*/
|
||||
class Version20180608130900 extends AbstractMigration
|
||||
{
|
||||
public function up(Schema $schema)
|
||||
{
|
||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
|
||||
|
||||
$this->addSql('ALTER TABLE station_mounts ADD custom_listen_url VARCHAR(255) DEFAULT NULL');
|
||||
}
|
||||
|
||||
public function down(Schema $schema)
|
||||
{
|
||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
|
||||
|
||||
$this->addSql('ALTER TABLE station_mounts DROP custom_listen_url');
|
||||
}
|
||||
}
|
|
@ -89,6 +89,12 @@ class StationMount
|
|||
*/
|
||||
protected $autodj_bitrate;
|
||||
|
||||
/**
|
||||
* @Column(name="custom_listen_url", type="string", length=255, nullable=true)
|
||||
* @var string|null
|
||||
*/
|
||||
protected $custom_listen_url;
|
||||
|
||||
/**
|
||||
* @Column(name="frontend_config", type="text", nullable=true)
|
||||
* @var string|null
|
||||
|
@ -299,6 +305,22 @@ class StationMount
|
|||
$this->autodj_bitrate = $autodj_bitrate;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getCustomListenUrl(): ?string
|
||||
{
|
||||
return $this->custom_listen_url;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param null|string $custom_listen_url
|
||||
*/
|
||||
public function setCustomListenUrl(string $custom_listen_url = null)
|
||||
{
|
||||
$this->custom_listen_url = $custom_listen_url;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
|
@ -416,4 +438,4 @@ class StationMount
|
|||
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue