[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

@@ -50,7 +50,12 @@ class BulkAddCSV extends Extension
*/
private function add_image(string $tmpname, string $filename, array $tags, string $source, string $rating, string $thumbfile)
{
$event = add_image($tmpname, $filename, $tags, $source);
$event = send_event(new DataUploadEvent($tmpname, [
'filename' => pathinfo($filename, PATHINFO_BASENAME),
'tags' => $tags,
'source' => $source,
]));
if (count($event->images) == 0) {
throw new UploadException("File type not recognised");
} else {