From 8fe160b38659aa2577b165d3884737c236e94a53 Mon Sep 17 00:00:00 2001
From: hit-cxf <2024111082@stu.hit.edu.cn>
Date: Sun, 07 Jun 2026 17:17:29 +0800
Subject: [PATCH] Added a feature for users to upload images

---
 video-claw/video-claw/frontend/components/stages/utils.ts |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/video-claw/video-claw/frontend/components/stages/utils.ts b/video-claw/video-claw/frontend/components/stages/utils.ts
index 8ef6f9e..78f88d0 100644
--- a/video-claw/video-claw/frontend/components/stages/utils.ts
+++ b/video-claw/video-claw/frontend/components/stages/utils.ts
@@ -11,6 +11,15 @@
   return '/' + path;
 }
 
+export function assetVersionLabel(path: string, index: number): string {
+  const file = (path || '').split('/').pop() || '';
+  const uploadMatch = file.match(/_upload_(v\d+)/i);
+  if (uploadMatch) return `用户上传: ${uploadMatch[1].toLowerCase()}`;
+  const aiMatch = file.match(/_v(\d+)\.[^.]+$/i);
+  const version = aiMatch ? `v${aiMatch[1]}` : `v${index + 1}`;
+  return `AI生成: ${version}`;
+}
+
 /* ─── 剧本 / 分镜 结构化文本解析 ─── */
 
 export interface ParsedCharacter {

--
Gitblit v1.8.0