[core] remove add_image, send_event(DataUpload) is much clearer as to what it's actually doing

This commit is contained in:
Shish
2024-01-09 19:24:56 +00:00
parent c16aeca4d8
commit 4d011fa5e5
6 changed files with 28 additions and 31 deletions

View File

@@ -52,7 +52,11 @@ class BulkImportExport extends DataHandlerExtension
file_put_contents($tmpfile, $stream);
$images = add_image($tmpfile, $item->filename, $item->new_tags)->images;
$images = send_event(new DataUploadEvent($tmpfile, [
'filename' => pathinfo($item->filename, PATHINFO_BASENAME),
'tags' => $item->new_tags,
'source' => null,
]))->images;
if (count($images) == 0) {
throw new SCoreException("Unable to import file $item->hash");