Skip to content

Conversation

niieani
Copy link

@niieani niieani commented Oct 13, 2025

Fixes #1121

Summary

  • Default immich-go upload from-folder runs were discarding files as "extension not included" because SetIncludeTypeExtensions() always seeded the include list with only sidecar extensions. That regression arrived when the Cobra PreRun guard was removed in a recent refactor.
  • The same refactor stopped wiring the parsed filesystem slice and journal recorder into ImportFolderCmd, so browsing never saw any assets and logging nil-panicked.
  • Fixes the bugs, add regression tests, and confirm the CLI can scan fixtures again.
  • folder adapter was enqueuing the files but the grouping pipeline never forwarded it downstream. The refactor left ImportFolderCmd with zero groupers configured, and the pipeline implementation silently short-circuited in that case, closing the channel without yielding any groups—hence the uploader immediately saw an empty stream.

Key Changes

  1. Extension guard & tests
    • Skip SetIncludeTypeExtensions() work unless --include-type is set.
    • Added unit tests in internal/cliFlags/extensionList_test.go for both default and VIDEO modes.
  2. Folder runner wiring
    • Persist the fshelper.ParsePath result in ImportFolderCmd.fsyss before spinning workers.
    • Ensure the command attaches a fileevent.Recorder when app.Jnl() is nil, preventing nil-pointer panics while logging.
  3. internal/groups/groups.go:35 now has a fast-path passthrough: when no groupers are registered,
    it simply forwards every asset from the adapter as a single-item group instead of closing the
    channel.

Verification

  • ran go test ./...
  • ran go run . upload from-folder test_folder --no-ui ... now correctly discovers files and no longer drops it as "extension not included" and uploads the files

Develop branch broke the default from-folder scan by always pre-populating InclusionFlags.IncludedExtensions with sidecar-only values. That meant Include() stopped returning true for MP4/ARW files whenever --include-type was left unset, so our fixture uploads discarded every clip. Only expand the include list when the user explicitly asks for IMAGE/VIDEO filtering, which matches the older Cobra PreRun hook. Added regression tests to prove the default path remains empty while VIDEO mode still seeds video+sidecar extensions.
Refactors in develop stopped assigning the parsed filesystem list to ImportFolderCmd and never initialised the file-event journal. Browse() therefore iterated a nil slice (so zero assets were discovered) and any logging attempt crashed with a nil recorder. Copy the fshelper.ParsePath result into ifc.fsyss before kicking off workers and ensure the command boots a Recorder from the application logger when none exists. Fixture upload now finds the clip again and logs without panicking.
when no groupers are registered, simply forward every asset from the adapter as a single-item group instead of closing the channel
@jeffreyskipl
Copy link

hey so we need to wait untill merged and new version availale to see it working? (sorry I don't get Git yet)

@niieani niieani changed the title fix: from-folder defaults to blank in immich-go develop fix: from-folder discarding files as "extension not included" 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.

2 participants