getStation(); $media = $mediaRepo->find($media_id, $station); if (!($media instanceof Entity\StationMedia)) { return $response->withStatus(404) ->withJson(Entity\Api\Error::notFound()); } $flowResponse = Flow::process($request, $response, $station->getRadioTempDir()); if ($flowResponse instanceof ResponseInterface) { return $flowResponse; } $mediaRepo->updateAlbumArt( $media, $flowResponse->readAndDeleteUploadedFile() ); $em->flush(); return $response->withJson(new Entity\Api\Status()); } }