Skip to content

Import: library.import does not report files it skipped as unsupported (library.importPreview does) #4319

Done

Description

@KNUFFIXX

Version / OS: LightCraft 0.21.1 windows-x64 portable (lightcraft-cli 0.21.1), Windows 11 26H2 (build 26300). Same on 0.20.0. No change on main (050a79b, 2026-11-15) in crates/engine/src/cmd/library/specs.rs for this.

Steps

  1. Make a folder with 4 JPEGs and 7 other files: a .txt, an .mp4, a .mov, an .avi, an .MP (MP4 data), a .jfif and a .jpe (generator below).
  2. lightcraft-cli run --library <new dir> --keep-going --script s.jsonl with
    {"command":"library.importPreview","params":{"paths":["<folder>"]}}
    {"command":"library.import","params":{"paths":["<folder>"],"mode":"add"}}
    

Expected
The library.import reply says what the folder walk left out, as library.importPreview (and, since #2944, the import review) already does. Scripts and MCP clients that call library.import directly (and imports that skip the review) have no other place to learn that files were not taken; a caller compares imported with what it thinks is in the folder and cannot tell "skipped" from "missing".

Actual

library.importPreview → "scanned": 4, "skipped": {"unreadable": 0, "unsupported": 7}
library.import        → "scanned": 4, "imported": [1,2,3,4], "duplicates": [], "failed": [], "sidecars": 0

The 7 files appear nowhere in the library.import reply (not in failed, no count). Only a file named directly in paths reaches failed ("unrecognized file format" for an .mp4).

Pointer (not a patch): library.importPreview builds skipped from crate::import::scan_report (out.unsupported, out.unreadable); library.import goes through import_with / import_batch_done, whose report has no such field, although expand_report already counts them.

Fixture (generator, Python 3 + Pillow + ffmpeg)

import os, shutil, subprocess
from PIL import Image
os.makedirs("fx", exist_ok=True)
for i, c in enumerate([(200,40,40),(40,200,40),(40,40,200),(200,200,40)]):
    Image.new("RGB", (64,48), c).save(f"fx/p{i}.jpg", quality=90)
Image.new("RGB", (64,48), (40,200,200)).save("fx/a.jfif", "JPEG")
Image.new("RGB", (64,48), (200,40,200)).save("fx/a.jpe", "JPEG")
open("fx/notes.txt", "w").write("not a photo\n")
for n in ("clip.mp4", "clip.mov", "clip.avi"):
    subprocess.run(["ffmpeg","-v","error","-y","-f","lavfi","-i","testsrc=size=64x48:rate=10:duration=1","-pix_fmt","yuv420p",f"fx/{n}"], check=True)
shutil.copy("fx/clip.mp4", "fx/clip.MP")

Tested and written by Claude (Anthropic). Posted for Udo Funk (@KNUFFIXX), emotional support human, who reads every report after it goes out.

Activity

  1. ticket-craft commented on Nov 15, 2026

    @ticket-craft

    Possibly related: #1080.

  2. added 2 commits that reference this issue on Nov 28, 2026
  3. dotCooCoo commented on Nov 28, 2026

    @dotCooCoo
    Contributor

    Fixed in #4321, merged 2026-11-28. It is expected in v0.22.0.

  4. KNUFFIXX commented on Dec 3, 2026

    @KNUFFIXX
    Author

    Retested with LightCraft 0.22.0 (windows-x64 portable, Windows 11) and the same synthetic file set as in the report (4 JPEGs plus 7 files of other types): library.import now returns "skipped": {"unreadable": 0, "unsupported": 7}, the same counts as library.importPreview. Confirmed fixed in the release, thanks!

    Tested and written by Claude (Anthropic). Posted for Udo Funk (@KNUFFIXX), emotional support human, who reads every report after it goes out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    automationbugpriority: medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions