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