mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-18 21:16:47 +00:00
fc9742357b
Dispatch to a photo backend was `switch (photo.provider)` in photo-resolver.service.ts twice and, in journey-public.controller.ts, an if/else that handed anything not named immich to Synology — where it 404'd from inside that provider's id parser. Adding a third backend meant finding all three. PhotoProviderRegistry.get(id) replaces them, over adapters registered under the PHOTO_PROVIDERS token in memories.module.ts. Adapters rather than `implements` on the services themselves: ImmichService and SynologyService are also the album and browse surfaces, and folding the interface into them would drag their argument orders and return shapes along. PhotoAssetRef is the part worth having. The two services took the same three values in different orders — Immich as (userId, assetId, ownerId), Synology as (userId, targetUserId, photoId) — so every dispatch site had to remember which was which, and a transposition would have compiled and served another user's photo. One place builds the ref, one place decrypts the Synology share passphrase. `local` stays an explicit branch at both dispatch sites: the bytes are on this disk, there is no row for it in photo_providers, and its asset info comes from the stored row rather than from a backend. The rename memories/ -> media/ is deliberately not here. It is import churn across 275 files, and coverage-thresholds.mjs buckets on one path segment, so merging photos/ in would collapse two ratchet entries into one and keep the looser of the two.