feat: add from-flickr adapter for importing Flickr account exports#1355
Open
jmcauley wants to merge 6 commits into
Open
feat: add from-flickr adapter for importing Flickr account exports#1355jmcauley wants to merge 6 commits into
jmcauley wants to merge 6 commits into
Conversation
Completed slices: - S01: S01 - S02: S02 - S03: S03 - S04: S04 GSD-Milestone: M001-cir324 Branch: milestone/M001-cir324
…ickr photo title When a photo has a title (md.Name), OriginalFileName was set to the bare title string with no extension. TypeFromExt then returned an empty type, causing every titled photo to fail with 'type file not supported'. Append path.Ext(entry.base) to preserve the extension from the original filename. Update TestBrowse fixture expectation to match.
Users download Flickr exports as multiple ZIPs manually from their account page. Requiring them to list every filename is impractical, especially for large accounts with many image archives. expandDirArgs() checks each arg before ParsePath: if it's a directory, glob *.zip inside and expand to individual paths. Non-directory args (explicit ZIPs, globs) pass through unchanged. Also updates Use string from '<metadata.zip> <images.zip>...' to '<download-dir | zip-file>...' to reflect the new interface.
… descriptions - Usage section now shows directory as primary form, with ZIP/glob as alternatives - Clarified which filename pattern belongs to metadata vs image archives (72157*.zip is metadata, data-download-*.zip are images — was inverted) - Added known limitation: directory scan is top-level only, no subdirectory recursion - Reworded export description to reflect the manual download process
Flickr's export always produces an empty people field even when photos have tagged users — confirmed with explicit tagging. Noted as a Flickr export bug, not an adapter limitation. Also clarified GPS: Flickr JSON geo field is empty, but EXIF GPS in the image file itself is preserved by Immich during upload.
- gci: fix import ordering in flickr.go and json.go - goconst: extract repeated "albums.json" string to albumsJSONFile constant
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.
Closes #1354
Summary
Adds a new
immich-go upload from-flickrsubcommand that imports a Flickr account export into Immich. Follows the same adapter pattern asfrom-google-photos.Usage
Point at the folder containing your downloaded Flickr ZIPs:
immich-go upload from-flickr \ --server http://your-immich:2283 \ --api-key YOUR_KEY \ ~/Downloads/flickr-export/Individual files and globs also work — the adapter identifies the metadata archive automatically by the presence of
albums.json, so order doesn't matter.What gets imported
namedescriptiondate_takendate_uploadtags[].tagalbums.jsonentries--sync-albums, default true)EXIF data including GPS is preserved as-is by Immich during upload.
Known export quirks
albumsfield in per-photo JSON is always empty in real Flickr exports; membership is sourced exclusively fromalbums.jsonpeoplefield even when photos have tagged users (Flickr export bug, not something we can work around)geofield in per-photo JSON was empty in all tested exports; EXIF GPS is preserved normallyChanges
adapters/flickr/flickr.go—FlickrCmdstruct,classifyArchives(),extractPhotoID(), two-passBrowse()goroutineadapters/flickr/json.go—FlickrMetadata/FlickrAlbumsJSON structs,AsMetadata()converter,albumIndex()helperadapters/flickr/cmd.go— cobra wiring,--sync-albumsflag, directory expansion for ZIP auto-discoveryadapters/flickr/flickr_test.go— 26 unit tests (archive classifier, ID extractor, Browse with fixtures)app/upload/upload.go— registerfrom-flickrsubcommanddocs/misc/flickr-import.md— user-facing documentationTesting
Tested against a real Flickr export (608 photos across 3 ZIPs):
go test ./adapters/flickr/...— 26/26 passgolangci-lint run ./adapters/flickr/...— 0 issuesgo build ./...— clean