Repository navigation
Immich: rescan libraries after changes, open-in-Immich links for duplicate groups - #529
Merged
Merged
Conversation
…h assets
- immich.rescan_after_changes (default false): after files were really moved or
deleted, queue a scan of the affected Immich external libraries (all of them if
none matches), at most once per deduplication run / batch of executed user
decisions. Runs in a background thread, errors are only logged as warnings.
Needs an admin API key with library.read and library.update.
- GET /api/groups/{id}/immich: Immich asset ids and links per candidate, local
paths mapped with the inverse of immich.path_mappings, looked up via the
search filter originalPath.in (Immich >= v3.2.0, falls back to the deprecated
originalPath parameter). Cached for 60s, Immich errors are reported in the
response instead of failing.
- immich.public_url: Immich URL as reachable from the browser (falls back to
immich.url), used for the "open in Immich" links in the group detail page.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| "asset_id": asset_id, | ||
| "url": f"{base_url}/photos/{asset_id}" if asset_id is not None else None, | ||
| }) | ||
| return {"configured": True, "url": base_url, "error": error, "candidates": candidates} |
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
immich.rescan_after_changes, defaultfalse): after py-image-dedup really moved or deleted files (never in dry run), it queues a scan (POST /api/libraries/{id}/scan) of the Immich external libraries whose import paths contain the affected files (all external libraries if none matches). At most once per deduplication run (full or incremental, triggered fromprocess_duplicates) and once per batch of executed web UI decisions. Runs in a background thread with a 10s request timeout; an unreachable Immich only logs a warning.GET /api/groups/{id}/immichreturns the asset id and link per candidate. Local paths are mapped with the inverse ofimmich.path_mappingsand looked up with onePOST /api/search/metadatausingfilter.originalPath.in(Immich >= v3.2.0); on HTTP 400/422 it falls back to the deprecatedoriginalPathparameter (substring match, filtered exactly client side). Results (and errors) are cached for 60s; Immich errors are returned inerrorand never fail the group page. The group detail view shows an "open in Immich ↗" link per candidate.immich.public_url: URL of Immich as reachable from the browser for those links, falls back toimmich.url. Also exposed inGET /api/integrations/immich(together withrescan_after_changes).Immich API key permissions
asset.read: trash import and asset links (as before).library.read+library.update: only forrescan_after_changes. In Immich (checked against the v3.3.5 OpenAPI spec)GET /api/librariesandPOST /api/libraries/{id}/scanare admin only, so the API key must belong to an admin user.Test plan
poetry run pytest(client: path inverse mapping, asset lookup + fallback, library selection/scan, admin permission error; deduplicator: rescan once after real moves, not in dry run / when disabled, Immich down only warns; API: links, caching, public URL, Immich down)npm --prefix web run lint,npm --prefix web run build🤖 Generated with Claude Code