refactor: NAS mirror uses base folder directly (no redundant klarbild segment)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XNQ8ghPfzAfsyVYd6HgFb6
This commit is contained in:
2026-07-23 20:32:50 +00:00
parent 3bfeadbaa0
commit 5fba397efa
+2 -1
View File
@@ -77,7 +77,8 @@ export async function mirrorItemToNas(itemId: string): Promise<{ ok: boolean; me
try {
const buf = await getObject(it.result_path);
const ym = new Date(it.created_at || Date.now()).toISOString().slice(0, 7); // JJJJ-MM
await uploadToNas(cfg, posixpath.join('klarbild', ym), it.filename || `${it.id}.png`, buf);
// Struktur: <Basisordner>/JJJJ-MM/<Datei> — der Basisordner ist frei wählbar.
await uploadToNas(cfg, ym, it.filename || `${it.id}.png`, buf);
await query(`UPDATE items SET nas_status='mirrored' WHERE id=$1`, [itemId]);
return { ok: true, message: 'Auf NAS gesichert.' };
} catch (e: any) {