Compare commits

...
Author SHA1 Message Date
spark 174277868d Autopilot: also edit and pick hand-uploaded photos
ci / rust (pull_request) Successful in 13m38s
ci / typescript (pull_request) Failing after 14m8s
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
2026-10-17 16:11:40 +00:00
spark 3d407f5524 Merge pull request 'Ship pending library, delivery and FTP fixes' (#9) from task/ship-pending into main
ci / rust (push) Successful in 7m59s
ci / typescript (push) Successful in 10m14s
2026-10-17 16:07:24 +01:00
2 changed files with 5 additions and 4 deletions

No files matched your search

+3 -2
View File
@@ -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: {
+2 -2
View File
@@ -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<void> {
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);
}