Fixes #5452 -- Fix types on streamer broadcast download.
This commit is contained in:
parent
7046e16458
commit
d8becc0844
|
@ -553,19 +553,17 @@ return static function (RouteCollectorProxy $group) {
|
|||
->add(new Middleware\Permissions(StationPermissions::Streamers, true));
|
||||
|
||||
$group->group(
|
||||
'/streamer/{id}',
|
||||
'/streamer/{streamer_id}',
|
||||
function (RouteCollectorProxy $group) {
|
||||
$group->get(
|
||||
'/broadcasts',
|
||||
Controller\Api\Stations\Streamers\BroadcastsController::class . ':listAction'
|
||||
)
|
||||
->setName('api:stations:streamer:broadcasts');
|
||||
)->setName('api:stations:streamer:broadcasts');
|
||||
|
||||
$group->get(
|
||||
'/broadcast/{broadcast_id}/download',
|
||||
Controller\Api\Stations\Streamers\BroadcastsController::class . ':downloadAction'
|
||||
)
|
||||
->setName('api:stations:streamer:broadcast:download');
|
||||
)->setName('api:stations:streamer:broadcast:download');
|
||||
|
||||
$group->delete(
|
||||
'/broadcast/{broadcast_id}',
|
||||
|
|
|
@ -25,12 +25,12 @@ final class BroadcastsController extends AbstractApiCrudController
|
|||
ServerRequest $request,
|
||||
Response $response,
|
||||
string $station_id,
|
||||
?string $id = null
|
||||
?string $streamer_id = null
|
||||
): ResponseInterface {
|
||||
$station = $request->getStation();
|
||||
|
||||
if (null !== $id) {
|
||||
$streamer = $this->getStreamer($station, $id);
|
||||
if (null !== $streamer_id) {
|
||||
$streamer = $this->getStreamer($station, $streamer_id);
|
||||
|
||||
if (null === $streamer) {
|
||||
return $response->withStatus(404)
|
||||
|
@ -66,13 +66,13 @@ final class BroadcastsController extends AbstractApiCrudController
|
|||
$fsRecordings = (new StationFilesystems($station))->getRecordingsFilesystem();
|
||||
|
||||
$paginator->setPostprocessor(
|
||||
function ($row) use ($id, $is_bootgrid, $router, $fsRecordings) {
|
||||
function ($row) use ($streamer_id, $is_bootgrid, $router, $fsRecordings) {
|
||||
$return = $this->toArray($row);
|
||||
|
||||
unset($return['recordingPath']);
|
||||
$recordingPath = $row->getRecordingPath();
|
||||
|
||||
if (null === $id) {
|
||||
if (null === $streamer_id) {
|
||||
$streamer = $row->getStreamer();
|
||||
$return['streamer'] = [
|
||||
'id' => $streamer->getId(),
|
||||
|
@ -85,7 +85,7 @@ final class BroadcastsController extends AbstractApiCrudController
|
|||
$routeParams = [
|
||||
'broadcast_id' => $row->getId(),
|
||||
];
|
||||
if (null === $id) {
|
||||
if (null === $streamer_id) {
|
||||
$routeParams['id'] = $row->getStreamer()->getId();
|
||||
}
|
||||
|
||||
|
@ -126,6 +126,7 @@ final class BroadcastsController extends AbstractApiCrudController
|
|||
ServerRequest $request,
|
||||
Response $response,
|
||||
string $station_id,
|
||||
string $streamer_id,
|
||||
string $broadcast_id
|
||||
): ResponseInterface {
|
||||
$station = $request->getStation();
|
||||
|
@ -158,6 +159,7 @@ final class BroadcastsController extends AbstractApiCrudController
|
|||
ServerRequest $request,
|
||||
Response $response,
|
||||
string $station_id,
|
||||
string $streamer_id,
|
||||
string $broadcast_id
|
||||
): ResponseInterface {
|
||||
$station = $request->getStation();
|
||||
|
|
|
@ -291,7 +291,7 @@ final class StreamersController extends AbstractScheduledEntityController
|
|||
|
||||
$return['links']['broadcasts'] = (string)$router->fromHere(
|
||||
route_name: 'api:stations:streamer:broadcasts',
|
||||
route_params: ['id' => $record->getId()],
|
||||
route_params: ['streamer_id' => $record->getId()],
|
||||
absolute: !$isInternal
|
||||
);
|
||||
$return['links']['art'] = (string)$router->fromHere(
|
||||
|
|
Loading…
Reference in New Issue