Fix bin delete removing source image

Source images are shared entities managed through the Images gallery.
Deleting a bin should only remove the processed output (image_filename),
not the source.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-03 03:07:29 +00:00
parent 7e70864907
commit b200a7ec8d

View File

@@ -859,8 +859,8 @@ app.put('/api/bins/:id', (req, res) => {
app.delete('/api/bins/:id', (req, res) => {
const bin = get_bin(req.params.id);
if (!bin) return fail(res, 'not found', 404);
// Only delete the processed output — source image is managed independently
if (bin.image_filename) remove_image_file(bin.image_filename);
remove_image_file(bin.source_id);
delete_bin(bin.id);
ok(res);
});