Add the optional Immich integration and manual gallery push
Immich connections stay server-side with an encrypted API key, albums can be imported, and photos are only sent back when an event's push button is pressed: originals upload once, edited photos re-render, and edits hashes plus checksums skip anything already in Immich. This also lands the accompanying editor, cloud and administration work that was still uncommitted. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
This commit is contained in:
+10
-2
@@ -11,6 +11,7 @@ import crypto from 'node:crypto';
|
||||
import { BRIDGE_SECRET, BRIDGE_TTL_HOURS, GLENLOCH_URL } from './config.mjs';
|
||||
import { db, removeEvent, removePhoto, saveEvent, savePhoto } from './db.mjs';
|
||||
import { removeAsset } from './storage.mjs';
|
||||
import { open, seal } from './secrets.mjs';
|
||||
|
||||
const VERSION = 'g1';
|
||||
|
||||
@@ -119,7 +120,14 @@ export function bridgePhotoId(sourcePhotoId) {
|
||||
}
|
||||
|
||||
export function bridgeForEvent(eventId) {
|
||||
return bridgeGet.get(eventId) ?? null;
|
||||
const row = bridgeGet.get(eventId);
|
||||
if (!row) return null;
|
||||
try {
|
||||
return { ...row, token: open(row.token) };
|
||||
} catch (err) {
|
||||
console.error(`[luminary] could not decrypt the bridge token for ${eventId}: ${err.message}`);
|
||||
return { ...row, token: '' };
|
||||
}
|
||||
}
|
||||
|
||||
/** Deletes an imported event, its rows and any cached previews/thumbnails. */
|
||||
@@ -208,7 +216,7 @@ export async function importBridgeEvent({ serviceToken, sessionId, ownerId = ''
|
||||
bridgeInsert.run(
|
||||
eventId,
|
||||
sessionId,
|
||||
serviceToken,
|
||||
seal(serviceToken),
|
||||
GLENLOCH_URL,
|
||||
listing.event.id,
|
||||
returnUrl,
|
||||
|
||||
Reference in New Issue
Block a user