Compare commits
1
Commits
b3fb74fb1b
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1877fee258 |
@@ -434,7 +434,7 @@ class Recording extends Model
|
||||
$startedAt = $this->transcription_started_at;
|
||||
$durationSeconds = $startedAt === null
|
||||
? null
|
||||
: max(0, (int) round($startedAt->diffInSeconds($finishedAt)));
|
||||
: max(0, $finishedAt->getTimestamp() - $startedAt->getTimestamp());
|
||||
|
||||
$this->forceFill([
|
||||
'transcript' => $text,
|
||||
|
||||
@@ -210,7 +210,7 @@ class RecordingUploadTest extends TestCase
|
||||
|
||||
Transcription::fake(['Hello from the recorder.']);
|
||||
|
||||
$this->freezeTime();
|
||||
$this->travelTo(now()->startOfSecond());
|
||||
|
||||
$recording = Recording::query()->create([
|
||||
'user_id' => $this->user->id,
|
||||
@@ -231,6 +231,10 @@ class RecordingUploadTest extends TestCase
|
||||
$this->assertSame(100, $recording->transcription_percent);
|
||||
$this->assertSame('Transcription complete', $recording->transcription_progress);
|
||||
$this->assertNotNull($recording->transcribed_at);
|
||||
$this->assertSame(
|
||||
$recording->transcribed_at->getTimestamp() - $recording->transcription_started_at->getTimestamp(),
|
||||
$recording->transcription_duration_seconds,
|
||||
);
|
||||
$this->assertSame(42, $recording->transcription_duration_seconds);
|
||||
$this->assertSame('42s', $recording->transcriptionStatusPayload()['transcription_duration_human']);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user