Add Docker stack, Reverb live progress, and duplicate upload detection.
Ship FrankenPHP Compose services with Reverb WebSockets for real-time transcription status, skip re-uploading identical audio via content hash, and format disk usage without requiring intl.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Events\RecordingTranscriptionUpdated;
|
||||
use App\Jobs\TranscribeRecording;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Attributes\Scope;
|
||||
@@ -28,6 +29,7 @@ class Recording extends Model
|
||||
'artist',
|
||||
'album',
|
||||
'file_size_bytes',
|
||||
'content_hash',
|
||||
'transcript',
|
||||
'transcription_status',
|
||||
'transcription_progress',
|
||||
@@ -129,7 +131,9 @@ class Recording extends Model
|
||||
'transcribed_at' => $this->transcribed_at,
|
||||
]);
|
||||
|
||||
TranscribeRecording::dispatch($this->fresh());
|
||||
$recording = $this->fresh();
|
||||
RecordingTranscriptionUpdated::dispatch($recording);
|
||||
TranscribeRecording::dispatch($recording);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -349,6 +353,8 @@ class Recording extends Model
|
||||
'transcription_percent' => $this->transcription_percent ?: 0,
|
||||
'transcription_error' => 'Stopped by user',
|
||||
])->save();
|
||||
|
||||
RecordingTranscriptionUpdated::dispatch($this->fresh());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -376,6 +382,8 @@ class Recording extends Model
|
||||
'transcription_percent' => $this->transcription_percent ?: 0,
|
||||
'transcription_error' => $message,
|
||||
])->save();
|
||||
|
||||
RecordingTranscriptionUpdated::dispatch($this->fresh());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -405,6 +413,16 @@ class Recording extends Model
|
||||
'transcription_percent' => max(0, min(100, $percent)),
|
||||
'transcription_error' => null,
|
||||
])->save();
|
||||
|
||||
RecordingTranscriptionUpdated::dispatch($this->fresh());
|
||||
}
|
||||
|
||||
/**
|
||||
* Broadcast the current transcription status to connected browsers.
|
||||
*/
|
||||
public function broadcastTranscriptionUpdated(): void
|
||||
{
|
||||
RecordingTranscriptionUpdated::dispatch($this->fresh() ?? $this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user