Protect recordings per user, seed a demo login on container start, and bind-mount the app with Vite HMR for local Compose development.
26 lines
715 B
PHP
26 lines
715 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use App\Http\Requests\TranscribeRecordingRequest;
|
|
use App\Models\Recording;
|
|
use Illuminate\Http\RedirectResponse;
|
|
use Illuminate\Support\Facades\Gate;
|
|
|
|
class TranscribeController extends Controller
|
|
{
|
|
/**
|
|
* Queue local faster-whisper transcription for the recording.
|
|
*
|
|
* Always allowed: stops any current run first, then starts a new one.
|
|
*/
|
|
public function __invoke(TranscribeRecordingRequest $request, Recording $recording): RedirectResponse
|
|
{
|
|
Gate::authorize('transcribe', $recording);
|
|
|
|
$recording->queueLocalTranscription();
|
|
|
|
return back()->with('success', 'Transcription started. Progress updates below.');
|
|
}
|
|
}
|