Implement smart default fallbacks for no-disconnect restarts.
This commit is contained in:
parent
120c51733e
commit
f8e2e7ce1d
|
@ -970,7 +970,7 @@ class ConfigWriter implements EventSubscriberInterface
|
|||
): string {
|
||||
$charset = $station->getBackendConfig()->getCharset();
|
||||
|
||||
$format = $mount->getAutodjFormatEnum() ?? StreamFormats::Mp3;
|
||||
$format = $mount->getAutodjFormatEnum() ?? StreamFormats::default();
|
||||
$output_format = $this->getOutputFormatString(
|
||||
$format,
|
||||
$mount->getAutodjBitrate() ?? 128
|
||||
|
|
|
@ -32,4 +32,9 @@ enum StreamFormats: string
|
|||
default => false,
|
||||
};
|
||||
}
|
||||
|
||||
public static function default(): self
|
||||
{
|
||||
return self::Mp3;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ namespace App\Radio\Frontend;
|
|||
|
||||
use App\Entity;
|
||||
use App\Radio\CertificateLocator;
|
||||
use App\Radio\Enums\StreamFormats;
|
||||
use App\Utilities;
|
||||
use App\Xml\Writer;
|
||||
use Exception;
|
||||
|
@ -211,6 +212,12 @@ class Icecast extends AbstractFrontend
|
|||
if (!empty($mount_row->getFallbackMount())) {
|
||||
$mount['fallback-mount'] = $mount_row->getFallbackMount();
|
||||
$mount['fallback-override'] = 1;
|
||||
} elseif ($mount_row->getEnableAutodj()) {
|
||||
$autoDjFormat = $mount_row->getAutodjFormatEnum() ?? StreamFormats::default();
|
||||
$autoDjBitrate = $mount_row->getAutodjBitrate();
|
||||
|
||||
$mount['fallback-mount'] = '/fallback-[' . $autoDjBitrate . '].' . $autoDjFormat->getExtension();
|
||||
$mount['fallback-override'] = 1;
|
||||
}
|
||||
|
||||
if ($mount_row->getMaxListenerDuration()) {
|
||||
|
|
Loading…
Reference in New Issue