Skip to content

Conversation

@niieani
Copy link
Contributor

@niieani niieani commented Oct 13, 2025

Issue

I'm seeing an album with an empty name created when uploading images, even when no option that indicates an album should be created (like --folder-as-album or --into-album) is added.

Here's what I see in logs:

{"time":"2025-10-13T09:12:58.989093-07:00","level":"INFO","msg":"added to an album","file":"fixture_metadata:pixel-photo/PXL_20250215_001150100.jpg","album":""}
{"time":"2025-10-13T09:12:58.995687-07:00","level":"INFO","msg":"created album","album":"","assets":2}

Root cause

  • In ImportFolderCmd.RegisterFlags the default is assigned as the lowercase string "none" instead of the AlbumFolderMode constant adapters/folder/commands.go:60 Because the enum values are uppercase ("NONE", "FOLDER", "PATH"), the later check ifc.UsePathAsAlbumName != FolderModeNone evaluates true for the default, so the album-building branch always runs.
  • Inside that branch the switch has no matching case, leaving Album as the empty string; nevertheless a.Albums is set to []assets.Album{{Title: ""}}, so every upload is queued for an album whose key/title is "" adapters/folder/run.go:394-431.
  • The upload pipeline dutifully creates that album, yielding the added to an album and created album log lines with an empty title app/upload/run.go:533-542, app/upload/run.go:499-544.

Fix Summary

  • ensure the default folder uploader album mode uses the NONE constant
  • allow AlbumFolderMode to accept "none" input explicitly
  • add regression tests covering the default and parser behavior

Testing

  • GOCACHE=/Volumes/Projects/Software/mio/immich-go/.gocache go test ./adapters/folder -run TestRegisterFlagsSetsAlbumModeNone

@niieani niieani changed the title fix: prevent default folder uploads from creating albums fix: prevent default folder uploads from creating albums when not asked to Oct 13, 2025
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