Raise audio upload limit to 2 GB per file.

Update validation, dropzone checks, Docker PHP ini, and docs so multi-hour recordings can be uploaded.
This commit is contained in:
ben
2026-08-12 17:42:55 +02:00
parent 771ee8db5a
commit e81a27cb8f
8 changed files with 63 additions and 7 deletions
@@ -99,4 +99,20 @@ class RecordingDuplicateUploadTest extends TestCase
$this->assertSame(1, Recording::query()->count());
Bus::assertNothingDispatched();
}
public function test_stored_recording_persists_content_hash(): void
{
Storage::fake('local');
Bus::fake();
$file = UploadedFile::fake()->createWithContent('hash-me.mp3', 'payload-for-hash');
$this->post(route('recordings.store'), [
'audio' => [$file],
])->assertRedirect();
$recording = Recording::query()->first();
$this->assertNotNull($recording);
$this->assertSame(hash('sha256', 'payload-for-hash'), $recording->content_hash);
}
}
+21
View File
@@ -2,6 +2,7 @@
namespace Tests\Feature;
use App\Http\Requests\StoreRecordingRequest;
use App\Jobs\TranscribeRecording;
use App\Models\Recording;
use App\Services\TranscriptionService;
@@ -87,9 +88,29 @@ class RecordingUploadTest extends TestCase
$this->get(route('recordings.create'))
->assertOk()
->assertSee('Drop audio files here')
->assertSee('max 2 GB each', false)
->assertSee('name="audio[]"', false);
}
public function test_files_larger_than_two_gigabytes_are_rejected(): void
{
Storage::fake('local');
Bus::fake();
$file = UploadedFile::fake()
->create('huge.mp3', 10, 'audio/mpeg')
->size(StoreRecordingRequest::MAX_AUDIO_KILOBYTES + 1);
$this->from(route('recordings.create'))
->post(route('recordings.store'), [
'audio' => [$file],
])
->assertSessionHasErrors(['audio.0']);
$this->assertSame(0, Recording::query()->count());
Bus::assertNothingDispatched();
}
public function test_user_can_upload_wav_and_ogg(): void
{
Storage::fake('local');