feat(lightroom): auto-link Lightroom cloud photos and videos to dives#566
Merged
Conversation
5cba972 to
4d8afe2
Compare
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
…UD and remote-asset dedup queries (schema v104)
…, suggestions, poll
…ion, auto-poll provider
…rings (11 locales)
…in Lightroom in viewer
…rror paths, viewer action, entity equality, auto-poll failure
14c04e1 to
bed668c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adobe Lightroom cloud auto-linking: connect a Lightroom catalog (BYO Adobe client ID), scan it manually or on a 6-hour startup poll, and photos/videos whose capture time falls inside a dive window
[entry - 30 min, exit + 60 min]attach automatically. Confident matches link immediately with depth/temperature enrichment; ambiguous ones (overlapping windows on repetitive-dive days) become one-tap suggestions on the dive detail page. Rendition bytes flow through the #550 Media Store pipeline, so linked media displays on every synced device while the originals stay in Adobe's cloud.Design spec:
docs/superpowers/specs/2026-07-11-lightroom-auto-linking-design.md; implementation plan:docs/superpowers/plans/2026-07-11-lightroom-auto-linking.md(both already on main).Architecture
Lightroom is an acquisition source, not a live dependency. The feature fills two sockets that already existed: the empty
serviceConnectorslot inMediaSourceResolverRegistry(newConnectorMediaResolver, whoseresolve()downloads the 2048 rendition), andMediaUploadPipeline._eligibleSources(#550), whose existing materialize -> hash -> dedup -> upload -> stamp flow now handles connector rows through that same resolver. Devices without the connector account display via the store fallback and never touch Adobe; disconnecting keeps every linked photo displaying from the store.Changes
connector_account_id/remote_asset_idonpending_photo_suggestions(PRAGMA-guarded idempotent DDL + beforeOpen re-assert; renumbered twice as the ladder climbed under it (v104 taken by the weight planner Weight prediction: personalized Weight Planner from dive history #564, v105 by the 3D flythrough heading migration Add per-sample compass heading capture (DC_SAMPLE_BEARING) #563); its test now holds the exact-latest version tripwire per the ladder convention)lib/core/services/lightroom/:AdobeImsAuthManager(OAuth2+PKCE against IMS, paste-the-redirected-URL flow, refresh-token rotation persisted, optional client secret),LightroomAuthStore(secure-storage blob),LightroomApiClient(abuse-guard stripping, pagination, capture-date filters, renditions), modelsdropbox/to sharedcore/services/oauth/oauth_pkce.dartConnectorAccountsRepository: first consumer of the v72connector_accountstableDivePhotoMatcher.matchTimestamp: confidence-bearing matching (unique extended-window hit or unique core hit = confident; else ambiguous, candidates ordered by entry proximity)LightroomScanService: merged capture-window spans (one API query per boat day, not per dive), dedup byremoteAssetIdagainst synced media rows BEFORE row creation (second-device scans are idempotent), attach + enrich + enqueue, suggestion fan-out, 90-day-lookback poll,confirmSuggestionremoteUploadedAtstays null so a future playback phase can tell posters from playable originals; backfill query gained the matching video-thumb clauseThumbnailGenerator: connector renditions decode as JPEG regardless oforiginalFilename(a video's poster carries a.mp4name and would otherwise never decode)Test Plan
flutter analyzeclean;dart format .cleanManual smoke pending (live Adobe account required)
captured_beforesupport on the assets endpoint (fallback documented in the plan if rejected)2048poster rendition existence (required by the thumb-only path)updated_sinceas a cheaper poll cursor (future optimization; poll works without it)