diff --git a/app/Http/Controllers/Api/Volumes/MetadataController.php b/app/Http/Controllers/Api/Volumes/MetadataController.php index 5cab2cc8a..fb6ed075f 100644 --- a/app/Http/Controllers/Api/Volumes/MetadataController.php +++ b/app/Http/Controllers/Api/Volumes/MetadataController.php @@ -81,7 +81,7 @@ public function store(StoreVolumeMetadata $request) // is not guaranteed that the file is overwritten. $request->volume->deleteMetadata(); $request->volume->saveMetadata($request->file('file')); - $request->volume->update(['metadata_parser' => $request->input('metadata_parser')]); + $request->volume->update(['metadata_parser' => $request->input('parser')]); Queue::push(new UpdateVolumeMetadata($request->volume)); } diff --git a/tests/php/Http/Controllers/Api/Volumes/MetadataControllerTest.php b/tests/php/Http/Controllers/Api/Volumes/MetadataControllerTest.php index a8e9c44a2..3c59d3166 100644 --- a/tests/php/Http/Controllers/Api/Volumes/MetadataControllerTest.php +++ b/tests/php/Http/Controllers/Api/Volumes/MetadataControllerTest.php @@ -83,6 +83,8 @@ public function testStoreImageMetadata() ]) ->assertStatus(200); + $this->assertSame(ImageCsvParser::class, $this->volume()->fresh()->metadata_parser); + Queue::assertPushed(UpdateVolumeMetadata::class, function ($job) { $this->assertEquals($this->volume()->id, $job->volume->id); @@ -130,6 +132,8 @@ public function testStoreVideoMetadataCsv() ]) ->assertSuccessful(); + $this->assertSame(VideoCsvParser::class, $this->volume()->fresh()->metadata_parser); + Queue::assertPushed(UpdateVolumeMetadata::class, function ($job) { $this->assertEquals($this->volume()->id, $job->volume->id);