feat: llms.txt (AI-readable docs), job delete, friendly missing-source error
- /llms.txt: public machine-readable capability/API/MCP doc for agents. - Job delete action + queue button for terminal jobs; cleans objects. - process.ts: clear 'Quelle nicht mehr vorhanden' message instead of raw EISDIR/ENOENT when a source was purged. - Docs corrected: Picdrop 'missing images' was web-UI sorting, not PNG; JPG delivery kept as size/perf improvement. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XNQ8ghPfzAfsyVYd6HgFb6
This commit is contained in:
@@ -34,6 +34,19 @@ export const POST: APIRoute = async ({ params, locals }) => {
|
||||
for (const it of items) await enqueue({ itemId: it.id, jobId: id });
|
||||
break;
|
||||
}
|
||||
case 'delete': {
|
||||
// Auftrag samt Positionen und deren Objekten entfernen (für alte/fehlgeschlagene Aufträge).
|
||||
const { deleteObject } = await import('../../../../lib/storage');
|
||||
const items = await query<any>(
|
||||
`SELECT source_path, source_paths, result_path, thumb_path FROM items WHERE job_id=$1`, [id]);
|
||||
for (const it of items) {
|
||||
const keys = [it.source_path, it.result_path, it.thumb_path, ...((it.source_paths as string[]) || [])].filter(Boolean);
|
||||
for (const k of keys) await deleteObject(k).catch(() => {});
|
||||
}
|
||||
await query(`DELETE FROM items WHERE job_id=$1`, [id]);
|
||||
await query(`DELETE FROM jobs WHERE id=$1`, [id]);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
return json({ error: 'Unbekannte Aktion.' }, 400);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user