From 174277868db603ae749a6be31dcaa5cbd0697d4a Mon Sep 17 00:00:00 2001 From: spark Date: Sat, 17 Oct 2026 16:11:40 +0000 Subject: [PATCH] Autopilot: also edit and pick hand-uploaded photos MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Autopilot skipped hand uploads (source UPLOAD) and only ran on photos that arrived by FTP or the desktop app's ingest. A second photographer often adds their photos by hand, and those should go through the event's autopilot too. Now autopilot runs for every source but archive re-imports (CLOUD) when the event has it switched on, both on arrival (ingest) and when photos join an event (adopt). The arrival rename is unchanged — hand uploads keep their own names. Claude-Session: https://claude.ai/code/session_01RAkmwWv6L5KmpX4h9JPD2i --- apps/api/src/ingest/service.ts | 5 +++-- apps/api/src/library/adopt.ts | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/api/src/ingest/service.ts b/apps/api/src/ingest/service.ts index 95c53e7..2b4001e 100644 --- a/apps/api/src/ingest/service.ts +++ b/apps/api/src/ingest/service.ts @@ -192,9 +192,10 @@ export class IngestService { const made = await this.makeDerivatives(orgId, sha256, storageKey); const { width, height } = origin.original?.width && origin.original.height ? { width: origin.original.width, height: origin.original.height } : made; const org = await db.organization.findUnique({ where: { id: orgId }, select: { biometricsEnabled: true } }); - // The event's autopilot edits what arrives by FTP or the desktop app's ingest; hand uploads stay as sent. + // The event's autopilot edits what arrives by FTP, the desktop app, or a hand upload (a second photographer's + // photos added by hand count too); only archive re-imports (CLOUD) are left as they were. const event = eventId ? await db.event.findUnique({ where: { id: eventId }, select: { autopilot: true, faceBoostedAt: true } }) : null; - const autopilot = origin.source !== "UPLOAD" && origin.source !== "CLOUD" && (event?.autopilot as { enabled?: boolean } | null)?.enabled === true; + const autopilot = origin.source !== "CLOUD" && (event?.autopilot as { enabled?: boolean } | null)?.enabled === true; photo = await db.photo.update({ where: { id: photo.id }, data: { diff --git a/apps/api/src/library/adopt.ts b/apps/api/src/library/adopt.ts index d2a9560..a882237 100644 --- a/apps/api/src/library/adopt.ts +++ b/apps/api/src/library/adopt.ts @@ -4,7 +4,7 @@ import { applyRename } from "./rename.js"; /** * Photos that just joined an event (moved by hand, or claimed from "Sem evento" when the event was created or its * window changed) get what arriving in it would have given them: the event's arrival name, faces analysed again so - * they group with the event's people, and the event's autopilot edit (FTP and desktop photos only, as on arrival). + * they group with the event's people, and the event's autopilot edit (everything but archive re-imports, as on arrival). */ export async function joinedEvent(db: Db, eventId: string, ids: string[]): Promise { if (!ids.length) return; @@ -17,7 +17,7 @@ export async function joinedEvent(db: Db, eventId: string, ids: string[]): Promi }); } if ((event.autopilot as { enabled?: boolean } | null)?.enabled === true) { - await db.photo.updateMany({ where: { id: { in: ids }, status: "READY", source: { not: "UPLOAD" }, autopilotStatus: "NONE" }, data: { autopilotStatus: "PENDING" } }); + await db.photo.updateMany({ where: { id: { in: ids }, status: "READY", source: { not: "CLOUD" }, autopilotStatus: "NONE" }, data: { autopilotStatus: "PENDING" } }); } for (const id of ids) await applyRename(db, id); } -- 2.47.3