Skip to content

feat: add from-flickr adapter for importing Flickr account exports#1355

Open
jmcauley wants to merge 6 commits into
simulot:developfrom
jmcauley:add-flickr-adapter
Open

feat: add from-flickr adapter for importing Flickr account exports#1355
jmcauley wants to merge 6 commits into
simulot:developfrom
jmcauley:add-flickr-adapter

Conversation

@jmcauley

@jmcauley jmcauley commented May 6, 2026

Copy link
Copy Markdown

Closes #1354

Summary

Adds a new immich-go upload from-flickr subcommand that imports a Flickr account export into Immich. Follows the same adapter pattern as from-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

Flickr field Immich field
name Title / OriginalFileName (with original extension preserved)
description Description
date_taken CaptureDate (primary)
date_upload CaptureDate (fallback)
tags[].tag Tags
albums.json entries Albums (--sync-albums, default true)

EXIF data including GPS is preserved as-is by Immich during upload.

Known export quirks

  • Album membership — the albums field in per-photo JSON is always empty in real Flickr exports; membership is sourced exclusively from albums.json
  • People tags — Flickr's export always produces an empty people field even when photos have tagged users (Flickr export bug, not something we can work around)
  • GPSgeo field in per-photo JSON was empty in all tested exports; EXIF GPS is preserved normally

Changes

  • adapters/flickr/flickr.goFlickrCmd struct, classifyArchives(), extractPhotoID(), two-pass Browse() goroutine
  • adapters/flickr/json.goFlickrMetadata / FlickrAlbums JSON structs, AsMetadata() converter, albumIndex() helper
  • adapters/flickr/cmd.go — cobra wiring, --sync-albums flag, directory expansion for ZIP auto-discovery
  • adapters/flickr/flickr_test.go — 26 unit tests (archive classifier, ID extractor, Browse with fixtures)
  • app/upload/upload.go — register from-flickr subcommand
  • docs/misc/flickr-import.md — user-facing documentation

Testing

Tested against a real Flickr export (608 photos across 3 ZIPs):

  • 604 photos uploaded successfully on first run
  • Duplicate detection correctly identified photos already in Immich
  • Dates, titles, tags, and album assignments all verified in Immich UI
  • go test ./adapters/flickr/... — 26/26 pass
  • golangci-lint run ./adapters/flickr/... — 0 issues
  • go build ./... — clean

jmcauley added 6 commits May 5, 2026 22:18
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
@jmcauley jmcauley requested a review from simulot as a code owner May 6, 2026 05:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant