Skip to content

导入覆盖三修:格式白名单放宽 + 跳过提示 + 导入即生成海报#181

Merged
appergb merged 1 commit into
mainfrom
feat/import-coverage
Jul 2, 2026
Merged

导入覆盖三修:格式白名单放宽 + 跳过提示 + 导入即生成海报#181
appergb merged 1 commit into
mainfrom
feat/import-coverage

Conversation

@appergb

@appergb appergb commented Jul 2, 2026

Copy link
Copy Markdown
Owner

①白名单放宽到 ffmpeg 实际可解(视频 3→14、音频 4→11、图片 6→9 种扩展名;上游 UTType 宽过滤的跨平台等价,已文档化)②不支持文件不再静默丢弃——MediaListDto 增 skipped 字段 + 前端 toast(治'导入没反应')③导入即生成网格海报(实证此前只读已缓存文件,新导入全是占位图)。顺带删除因本改动而孤立的 collect_media_files(零残留引用,测试等价替换)。门禁:workspace 1376 + web 330 全绿。

… on import

Three import-coverage fixes vs upstream (MediaTab / MediaAsset):

- Whitelist widened to what the ffmpeg backend actually decodes (upstream
  accepts anything AVFoundation recognizes, MediaTab.swift:754-756): video
  3->14 exts (+mkv/webm/avi/mts/m2ts/mpg/mpeg/3gp/wmv/flv/ts), audio 4->11
  (+flac/ogg/opus/aiff/aif/wma/caf), image 6->9 (+bmp/gif/avif). json/lottie
  still excluded (separate feature). Deliberate cross-platform divergence from
  upstream's UTType filter, documented. Dialog filters in mediaActions match.
- No more silent drops: MediaListDto gains `skipped: Vec<String>` (camelCase,
  default-empty, only import populates it); import_media/import_folder collect
  unsupported-type file names; frontend toasts "已跳过 N 个不支持的文件"
  (upstream mediaPanelToast, EditorViewModel+MediaLibrary.swift:65-68) —
  closes the "import did nothing" complaint class.
- Eager grid poster at import (upstream loadMetadata 320px poster,
  MediaAsset.swift:127-160): proven gap — import_one never generated a poster,
  the DTO only read an ALREADY-cached file, so fresh imports showed placeholders
  until the panel's lazy queue got to them. warm_import_poster now best-effort
  disk-caches the same 120x68 grid poster at import; failures swallowed
  (placeholder as before, never an import error).

Removed collect_media_files/collect_into (this change deleted their only
production caller; replaced by list_dir/list_top_level with equivalent tests;
zero remaining references).

Gates: fmt/clippy -D warnings clean; cargo test --workspace 1376; pnpm build
clean; pnpm test 330.
@appergb appergb merged commit 384b478 into main Jul 2, 2026
2 checks passed
@appergb appergb deleted the feat/import-coverage branch July 2, 2026 06:47
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.

1 participant