From 1e616b302ead41e5f80c98735b7690db55f8c046 Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Sun, 19 Jul 2026 10:45:34 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix(P1):=20=E4=BF=AE=E5=A4=8D=E8=A7=86?= =?UTF-8?q?=E9=A2=91=E5=BA=93=E5=B7=A6=E4=BE=A7=E5=88=97=E8=A1=A8=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=85=8D=E9=9F=B3=E5=BA=93=20-=20=E5=8E=BB=E6=8E=89ma?= =?UTF-8?q?pLibrary=E4=B8=ADvoice=E2=86=92video=E7=9A=84=E7=A1=AC=E6=98=A0?= =?UTF-8?q?=E5=B0=84=20(#564)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 根因:mapLibrary函数将kind=voice的库硬映射为video,导致 lib.kind === 'video'过滤失效,配音素材库出现在视频库左侧列表。 直接去掉映射逻辑,让kind保持原值,filter自然生效。 --- apps/web/src/pages/assets/AssetLibrary.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/src/pages/assets/AssetLibrary.tsx b/apps/web/src/pages/assets/AssetLibrary.tsx index 2f945e4dc..322665c08 100755 --- a/apps/web/src/pages/assets/AssetLibrary.tsx +++ b/apps/web/src/pages/assets/AssetLibrary.tsx @@ -142,7 +142,7 @@ const formatDuration = (seconds: number): string => { const mapLibrary = (item: AssetLibraryItem): LibraryItem => ({ id: item.id, name: item.name, - kind: (item.kind === "voice" ? "video" : item.kind) || inferKind("video"), + kind: item.kind || inferKind("video"), count: item.asset_count ?? 0, }) -- 2.54.0 From aedc0e37a23861b615bd6070484f22deab5c8f25 Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Sun, 19 Jul 2026 11:01:50 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix(P1):=20=E8=A1=A5=E5=85=85AssetKind?= =?UTF-8?q?=E7=9A=84voice=E7=B1=BB=E5=9E=8B=E5=AE=9A=E4=B9=89=EF=BC=8C?= =?UTF-8?q?=E4=BF=AE=E5=A4=8DTS=E7=B1=BB=E5=9E=8B=E6=A3=80=E6=9F=A5?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web/src/pages/assets/AssetLibrary.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/apps/web/src/pages/assets/AssetLibrary.tsx b/apps/web/src/pages/assets/AssetLibrary.tsx index 322665c08..4bee329b0 100755 --- a/apps/web/src/pages/assets/AssetLibrary.tsx +++ b/apps/web/src/pages/assets/AssetLibrary.tsx @@ -32,6 +32,7 @@ import { ThunderboltOutlined, CheckCircleOutlined, CloseCircleOutlined, + AudioOutlined, } from "@ant-design/icons" import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query" import { @@ -56,7 +57,7 @@ import "./assets.css" /* ============================================================ * 类型 * ============================================================ */ -type AssetKind = "video" | "image" +type AssetKind = "video" | "image" | "voice" type StatusType = "ok" | "warn" | "bad" | "info" interface LibraryItem { @@ -88,6 +89,7 @@ interface AssetItem { /** 根据 mime_type 推断前端 AssetKind */ const inferKind = (mimeType: string): AssetKind => { if (mimeType.startsWith("video/")) return "video" + if (mimeType.startsWith("audio/")) return "voice" return "image" } @@ -191,6 +193,8 @@ const kindIcon = (kind: AssetKind) => { return case "image": return + case "voice": + return } } @@ -200,6 +204,8 @@ const kindLabel = (kind: AssetKind) => { return "视频" case "image": return "图片" + case "voice": + return "配音" } } @@ -210,6 +216,8 @@ const thumbGradient = (kind: AssetKind): string => { return "linear-gradient(135deg, #312e81 0%, #4f46e5 50%, #6366f1 100%)" case "image": return "linear-gradient(135deg, #78350f 0%, #d97706 50%, #f59e0b 100%)" + case "voice": + return "linear-gradient(135deg, #064e3b 0%, #059669 50%, #10b981 100%)" } } -- 2.54.0