Conversation
The archive from-immich command was writing every media file as ~1, ~2, ... with no extension, because the from-immich adapter set Asset.OriginalFileName but never populated the embedded NameInfo (Base/Ext/Radical). writeFolder.WriteAsset uses a.Base to name the output file; when Base is empty, its disambiguation loop treats the destination directory itself as a name collision and falls through to the placeholder pattern. Every other source adapter (folder, googlePhotos, stack) already calls SetNameInfo via the InfoCollector. This aligns fromimmich with the same pattern using the already-initialised fic.ic collector. Fixes simulot#1412
This branch has not been deployed
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.
Summary
archive from-immichwrites every media file as~1,~2,~3, … with no extension. This makes the resulting archive unbrowsable (no extension → not associated with any viewer) and non-re-importable (upload from-folderreports every file asdiscovered unknown file … reason=useless file).The image data itself is intact — renaming a
~Nfile to its real name (present in the sibling.JSON) opens correctly.Root cause
writeFolder.WriteAsset(adapters/folder/writeFolder.go) usesa.Base(from the embeddedNameInfo) to name the output file. WhenBaseis empty, its collision-avoidance loop treats the destination directory itself as a name collision and falls through to the~Nplaceholder pattern.Every other source adapter populates
NameInfovia theInfoCollector:adapters/folder/run.go:551—a.SetNameInfo(ifc.infoCollector.GetInfo(n))adapters/googlePhotos/googlephotos.go:509—a.SetNameInfo(toc.infoCollector.GetInfo(a.OriginalFileName))app/stack/stack.go:97—asset.SetNameInfo(o.InfoCollector.GetInfo(asset.OriginalFileName))fromimmich/command.gowas settingAsset.OriginalFileNamebut neverNameInfo.FromImmichCmdalready initialisesfic.ic(anInfoCollector), so the fix reuses it in the same pattern.Fix
One line in
adapters/fromimmich/command.go, immediately afterasset := a.AsAsset():Verification
Rebuilt from this branch and re-ran
archive from-immichagainst Immich v3.1.0. Output now matches the format described indocs/commands/archive.md:Fixes #1412