feat(*): 分镜与资产 - 完善五类资产、候选去重、搜索、中文镜头编号与分类整理
This commit is contained in:
1 parent
ef30645cf0
commit
8984c567ac
53 files changed
+816
-188
No files matched your search
@@ -0,0 +1,15 @@
|
||||
const LEGACY_DEFAULT_SHOT_TITLE = /^SC\.\d+$/i;
|
||||
|
||||
export function formatShotOrdinal(index: number) {
|
||||
return `镜头${String(Math.max(0, index) + 1).padStart(2, "0")}`;
|
||||
}
|
||||
|
||||
export function normalizeDefaultShotTitle(title: string | undefined, index: number) {
|
||||
const value = (title || "").trim();
|
||||
return LEGACY_DEFAULT_SHOT_TITLE.test(value) ? formatShotOrdinal(index) : value;
|
||||
}
|
||||
|
||||
export function customShotTitle(title: string | undefined, index: number) {
|
||||
const value = normalizeDefaultShotTitle(title, index);
|
||||
return value === formatShotOrdinal(index) ? "" : value;
|
||||
}
|
||||
Reference in new issue
Block a user