Skip to content

fix(media): finish media library rewrite + migrate star to backend (#91)#215

Open
appergb wants to merge 1 commit into
mainfrom
fix/91-media-library-rewrite
Open

fix(media): finish media library rewrite + migrate star to backend (#91)#215
appergb wants to merge 1 commit into
mainfrom
fix/91-media-library-rewrite

Conversation

@appergb

@appergb appergb commented Jul 7, 2026

Copy link
Copy Markdown
Owner

Summary

Closes #91 (含 #49/#58). 后端文件夹树 / 递归 import_folder / 带 folders 的 MediaListDto 已在前序 PR (#104/#106) 并入 main;本 PR 补齐 #91 在前端的剩余缺口 + 把星标从 localStorage 迁到全局库后端。

Changes

不变量(未回归)

六项验证(全绿)

cargo fmt --all                                          # OK
cargo clippy --workspace --all-targets -- -D warnings   # OK (0 warnings)
cargo clippy -p opentake-tauri --no-default-features --all-targets -- -D warnings  # OK
cargo test --workspace                                   # OK (all crates pass)
pnpm -C web build                                        # OK (tsc + vite build)
pnpm -C web test                                         # OK (43 files, 440 tests)

文件清单(+345 / -72)

文件 变化 说明
web/src/components/media/MediaPanel.tsx +116 AI 占位、音频波形、星标 path-based、startFavoritesSync
web/src/components/media/favorites.ts +168 重写为后端薄包装 + 一次性迁移
web/src/components/media/favorites.test.ts +118 适配新 API(mock libraryApi)
web/src/components/media/MediaTabBar.tsx +1 SUB_TABS 加 "ai"
web/src/i18n/dict.ts +2 media.subtab.ai 中英
web/src/store/mediaStore.ts +8 refreshMedia 按 id 去重
web/src/store/uiStore.ts +4 MediaSubTabId 加 "ai"

备注

任务规格描述的"现状"(拍平、无钻取、localStorage 星标、无拖拽)部分已过时——这些在前序 PR 已实现。本 PR 聚焦 #91 真正剩余缺口,外科手术式改动,不重写已有功能。

…, #49, #58)

Backend folder tree / recursive import_folder / MediaListDto with folders already landed in prior PRs (#104/#106); this PR closes the remaining #91 gaps on the front end and migrates the star toggle from localStorage to the global library.

- frontend: add "AI Generate" subtab placeholder (skeleton for PR-5)

- frontend: audio cards render a waveform thumbnail via get_waveform (#91-B3)

- migrate: favorites localStorage -> library_favorite/library_unfavorite (#91-C)

  one-time migration on first sync: legacy ids -> library_favorite, then clear

- frontend: mediaStore dedup by item.id (defensive against concurrent re-fetch races; #91-A4)

- frontend: MediaSubTabId adds "ai"; i18n media.subtab.ai (zh/en)

No backend changes — #91-A (MediaFolder tree, folder_id, recursive import, get_media with folders) and #91-D (library->timeline drag-drop) were already on main. Does not regress relink_media / missing overlay / import whitelist / first-frame poster.
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.

[CRITICAL][media] 素材/媒体管理系统数据流错误,需删除并按剪映/CapCut 完全重写

1 participant