Fix double-slashes preceding media protocol; extend timeout on "cp" command.

This commit is contained in:
Buster "Silver Eagle" Neece 2022-04-08 21:37:33 -05:00
parent e465b787e4
commit 5d52ff4bbb
No known key found for this signature in database
GPG Key ID: 9FC8B9E008872109
2 changed files with 3 additions and 28 deletions

View File

@ -65,7 +65,7 @@ class Annotations implements EventSubscriberInterface
{
$media = $event->getMedia();
if ($media instanceof Entity\StationMedia) {
$event->setSongPath('media://' . ltrim($media->getPath(), '/'));
$event->setSongPath('media:' . ltrim($media->getPath(), '/'));
$backend = $this->adapters->getBackendAdapter($event->getStation());
$event->addAnnotations($backend->annotateMedia($media));

View File

@ -203,31 +203,6 @@ class ConfigWriter implements EventSubscriberInterface
EOF
);
/*
$stationId = $station->getIdRequired();
$event->appendBlock(
<<<EOF
def azuracast_api_call(~timeout=2, url, payload) =
command = "liquidsoap_cli --as-autodj #{url} ${stationId}"
response = list.hd(
process.read.lines(
env=[("PAYLOAD", payload)],
timeout=float_of_int(timeout),
command
),
default=""
)
log("API #{url} - Response: #{response}")
"#{response}"
end
EOF
);
}
*/
$mediaStorageLocation = $station->getMediaStorageLocation();
if ($mediaStorageLocation->isLocal()) {
@ -248,7 +223,7 @@ class ConfigWriter implements EventSubscriberInterface
j = json()
j.add("uri", arg)
[azuracast_api_call(timeout=5, "cp", json.stringify(j))]
[azuracast_api_call(timeout=20, "cp", json.stringify(j))]
end
EOF
);
@ -260,7 +235,7 @@ class ConfigWriter implements EventSubscriberInterface
"media",
azuracast_media_protocol,
doc="Pull files from AzuraCast media directory.",
syntax="media://uri"
syntax="media:uri"
)
EOF
);