Reject empty recording downloads and store WebM with correct MIME.
Deploy Ladill Meet / deploy (push) Successful in 31s
Deploy Ladill Meet / deploy (push) Successful in 31s
Mark legacy zero-byte placeholders as failed, validate files on show/download, and surface upload errors in the meeting room. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -121,6 +121,38 @@ class RecordingService
|
||||
return $recording->fresh();
|
||||
}
|
||||
|
||||
/** Mark ready recordings with missing/empty files as failed. */
|
||||
public function ensureStorageValid(Recording $recording): Recording
|
||||
{
|
||||
if ($recording->status !== 'ready' || ! $recording->storage_path) {
|
||||
return $recording;
|
||||
}
|
||||
|
||||
$disk = Storage::disk(config('meet.recordings.disk', 'local'));
|
||||
$size = $disk->exists($recording->storage_path) ? (int) $disk->size($recording->storage_path) : 0;
|
||||
|
||||
if ($size > 0) {
|
||||
if ((int) ($recording->file_size ?? 0) !== $size) {
|
||||
$recording->update(['file_size' => $size]);
|
||||
}
|
||||
|
||||
return $recording->fresh();
|
||||
}
|
||||
|
||||
if ($recording->storage_path) {
|
||||
$disk->delete($recording->storage_path);
|
||||
}
|
||||
|
||||
$recording->update([
|
||||
'status' => 'failed',
|
||||
'storage_path' => null,
|
||||
'file_size' => null,
|
||||
'failure_reason' => 'Recording file is missing or empty. Please record the meeting again.',
|
||||
]);
|
||||
|
||||
return $recording->fresh();
|
||||
}
|
||||
|
||||
public function delete(Recording $recording, string $actorRef): void
|
||||
{
|
||||
if ($recording->storage_path) {
|
||||
|
||||
Reference in New Issue
Block a user