fix(media): finish media library rewrite + migrate star to backend (#91)#215
Open
appergb wants to merge 1 commit into
Open
fix(media): finish media library rewrite + migrate star to backend (#91)#215appergb wants to merge 1 commit into
appergb wants to merge 1 commit into
Conversation
…, #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.
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
Closes #91 (含 #49/#58). 后端文件夹树 / 递归 import_folder / 带 folders 的 MediaListDto 已在前序 PR (#104/#106) 并入 main;本 PR 补齐 #91 在前端的剩余缺口 + 把星标从 localStorage 迁到全局库后端。
Changes
MediaSubTabId加"ai",MediaTabBarSUB_TABS 加段,MediaPanel渲染占位(接 PR-5 生成 UI)。骨架到位,避免后续改 MediaPanel 主架。MediaCard对type==='audio'的卡片在缩略图区渲染波形竖条(复用get_waveform命令,已存在)。decode 失败 / 无音频轨 → 回落类型图标。favorites.ts重写为薄包装,toggle调library_favorite/library_unfavorite(复用既有libraryApi.ts),状态从library_list按 source path 匹配。一次性迁移:首载检测 localStorage 旧星标 → 用当前 items 解析 id→path → 批量library_favorite→ 清 localStorage + 写迁移完成标志。refreshMedia用Map<id, item>强制 id 唯一,防御并发media_changedre-fetch 竞态。media.subtab.ai(中 / 英)。不变量(未回归)
六项验证(全绿)
文件清单(+345 / -72)
备注
任务规格描述的"现状"(拍平、无钻取、localStorage 星标、无拖拽)部分已过时——这些在前序 PR 已实现。本 PR 聚焦 #91 真正剩余缺口,外科手术式改动,不重写已有功能。