Skip to content

CLI --import <folder> uses the engine's import extensions (#1080) - #1119

Merged
bflatastic merged 1 commit into
storytold:mainfrom
itrycodinganditsbad:fix-1080
Oct 13, 2026
Merged

bflatastic merged 1 commit into
storytold:mainfrom
itrycodinganditsbad:fix-1080

Conversation

@itrycodinganditsbad

Copy link
Copy Markdown
Contributor

Fixes #1080

lightcraft-cli run --import <folder> walked folders with its own PHOTO_EXTENSIONS list in crates/mcp/src/headless.rs. That list was a copy of the engine's import::EXTENSIONS and had fallen behind: it was missing heic, heif and nrw. So the flag silently skipped HEIC files that library.import on the same folder took. The MCP tools that expand folders go through the same expand_paths, so they had the same gap.

expand_paths now filters with lightcraft_engine::import::is_supported and the copied list is gone, along with its pub use from lightcraft-mcp. Nothing else in the workspace used it. The desktop file pickers and the import dialog already used the engine list. I left the other extension lists alone because they are meant to differ: xtask/src/assets.rs is the asset attribution check, and raw_files in the CLI is a raw-only subset for its own command. HEIC without the heif feature works the same as library.import: the file is picked up and the import reports it as failed with the reason.

New test expand_paths_takes_the_engine_extensions: it makes one file for every engine extension plus B.HEIC and a .txt in a temp folder and checks that the walk returns exactly the supported ones. It failed before the fix (heic, heif, nrw and HEIC were missing) and passes now. I ran fmt, clippy -D warnings on lightcraft-mcp and lightcraft-cli (with --no-deps), and the tests for both crates. I didn't run the full cargo xtask ci locally and left that to GitHub CI. Workspace clippy fails here on an unrelated lint in crates/pipeline/src/spots.rs (chunks_exact_to_as_chunks, new in my local clippy 1.99). I didn't try it by hand with real iPhone HEICs.

🤖 Generated with Claude Code

…, NRW)

expand_paths kept its own PHOTO_EXTENSIONS list, which had fallen behind
lightcraft_engine::import::EXTENSIONS. It now filters with
import::is_supported, so folder walks and library.import take the same files.

Fixes storytold#1080

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@LloydNicholson

Copy link
Copy Markdown

An independent fix for #1080 made the same change: LloydNicholson/lightcraft@e94a56ad (branch fix-1080-import-folder-heic). It removes the copied list, filters the folder walk with lightcraft_engine::import::is_supported, and has a similar test. Two checks were run on it that cover this PR too, since the code is the same:

There won't be a second PR; this one covers it.

@itrycodinganditsbad

Copy link
Copy Markdown
Contributor Author

Thanks @LloydNicholson. Nice to have the real HEIC run and a full macOS CI pass on the same change.

@bflatastic

Copy link
Copy Markdown
Member

Landed on main in #1431. Batch 32a had landed #1254 for the same issue an hour earlier; main now has this version, which uses the engine's extension list instead of a second copy. Thank you, @itrycodinganditsbad!


Generated by Claude Code

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.

0.6.0: run --import <folder> skips HEIC/HEIF (the CLI's PHOTO_EXTENSIONS lags the engine's EXTENSIONS)

3 participants