Skip to content

Commit e7d1951

Browse files
committed
Fix images not being recorded correctly in new albums
1 parent 584bca8 commit e7d1951

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

src/main/php/de/thekid/dialog/api/Entries.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,10 @@ public function upload(#[Value] $user, string $id, string $name, #[Request] $req
6767
// Sort by date and time, then write back
6868
set: usort($images, fn($a, $b) => $a['meta']['dateTime'] <=> $b['meta']['dateTime']);
6969
$this->repository->modify($id, ['$set' => ['images' => $images]]);
70+
return $image;
7071
}
7172

73+
// Simply "OK" an upload w/o files
7274
return Response::ok();
7375
});
7476
}

src/main/php/de/thekid/dialog/import/Source.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ protected function mediaIn(Files $files): iterable {
6262
foreach ($files->in($this->origin) as $file => $processing) {
6363
$name= $file->filename;
6464
if (!isset($images[$name]) || $file->lastModified() > $images[$name]['modified']) {
65-
yield new UploadMedia($this->entry['slug'], $file, $processing);
65+
$this->entry['images'][$name]= yield new UploadMedia($this->entry['slug'], $file, $processing);
6666
}
6767
unset($images[$name]);
6868
}

src/main/php/de/thekid/dialog/import/UploadMedia.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function execute(Endpoint $api) {
2727
$upload->transfer($kind, $target->in(), $target->filename);
2828
}
2929

30-
return $upload->finish();
30+
return $upload->finish()->value();
3131
}
3232

3333
/** @return string */

0 commit comments

Comments
 (0)