Skip to content

Conversation

@niieani
Copy link
Contributor

@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.

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.

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

@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
@Gustry
Copy link

Gustry commented Oct 21, 2025

Related to #1122 as well

@niieani niieani force-pushed the fix/upload-default-scan branch 2 times, most recently from 4090952 to 76f0f5c Compare October 24, 2025 14:07
@harryfine
Copy link

I am not that technical a person, I've just been uploading today into a new immich installation and getting a lot of discrded. So I read your explanation above, but I'm not understanding if that actually discarded all these pictures, or it just said it did. Do I have to re-do all my uploadsd? And can I, will there be hash issues? Using immich-go version 0.28.0.

1

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.
@niieani niieani force-pushed the fix/upload-default-scan branch from 76f0f5c to 71480e4 Compare November 18, 2025 07:03
@niieani
Copy link
Contributor Author

niieani commented Nov 18, 2025

@simulot rebased on develop

@simulot
Copy link
Owner

simulot commented Nov 18, 2025

Hi, have you checked if the problem isn't already solved on the develop branch?

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.

5 participants