This commit is contained in:
2024-06-12 19:51:41 +02:00
parent 154e79aacd
commit 0ce904a7d8
18 changed files with 104 additions and 146 deletions

View File

@@ -4,7 +4,6 @@ namespace App\Services;
use App\ImportsMedia;
use App\Models\Album;
use Illuminate\Foundation\Bus\PendingChain;
use Illuminate\Http\UploadedFile;
use Symfony\Component\HttpKernel\Exception\UnsupportedMediaTypeHttpException;
@@ -17,10 +16,11 @@ class MediaImporter {
}
}
public function import(UploadedFile $file, Album $location): array {
public function import(UploadedFile $file, Album $location): void {
foreach ($this->importers as $importer) {
if($importer::supports($file)) {
return (new $importer($file, $location))->import();
(new $importer($file, $location))->import();
return;
}
}