Protect recordings per user, seed a demo login on container start, and bind-mount the app with Vite HMR for local Compose development.
27 lines
606 B
PHP
27 lines
606 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use App\Models\Recording;
|
|
use Illuminate\Http\JsonResponse;
|
|
use Illuminate\Support\Facades\Gate;
|
|
|
|
class TranscriptionStatusController extends Controller
|
|
{
|
|
/**
|
|
* Live transcription progress for polling.
|
|
*/
|
|
public function __invoke(Recording $recording): JsonResponse
|
|
{
|
|
Gate::authorize('view', $recording);
|
|
|
|
$recording = $recording->fresh();
|
|
|
|
if ($recording->recoverOrphanedTranscription()) {
|
|
$recording->refresh();
|
|
}
|
|
|
|
return response()->json($recording->transcriptionStatusPayload());
|
|
}
|
|
}
|