Library: - 添加 checkbox 和鼠标框选功能 - Unregistered 卡片添加快速注册按钮 - 状态标签移至左下方,人脸图标移至左侧中间 - Deep Scan 改为 unregister -> register -> process - 完整国际化(日语、繁体中文、英语) PeopleView: - 修复卡片不显示问题(使用 get_file_traces API) - 移除对 identity_id 字段的依赖 其他: - 添加日语语言包 - 添加 useDragSelect composable - 新增文档:Face Bbox Null Bug Report
48 lines
1.2 KiB
TypeScript
48 lines
1.2 KiB
TypeScript
export type AsrStatus = 'no_audio_track' | 'silent_audio' | 'has_transcript' | 'processing'
|
|
|
|
export interface AsrData {
|
|
language?: string
|
|
language_probability?: number
|
|
segments?: Array<{
|
|
start_time: number
|
|
end_time: number
|
|
text: string
|
|
}>
|
|
}
|
|
|
|
export function getAsrStatus(asr: AsrData | null | undefined): AsrStatus {
|
|
if (!asr) return 'processing'
|
|
|
|
const segments = asr.segments || []
|
|
const language = asr.language || ''
|
|
const langProb = asr.language_probability || 0
|
|
|
|
if (segments.length === 0) {
|
|
if (language === '' && langProb === 0) {
|
|
return 'no_audio_track'
|
|
}
|
|
return 'silent_audio'
|
|
}
|
|
|
|
return 'has_transcript'
|
|
}
|
|
|
|
export function getAsrStatusLabel(status: AsrStatus): string {
|
|
const labels: Record<AsrStatus, string> = {
|
|
'no_audio_track': 'No Audio Track',
|
|
'silent_audio': 'No Speech',
|
|
'has_transcript': 'Has Speech',
|
|
'processing': 'Processing'
|
|
}
|
|
return labels[status]
|
|
}
|
|
|
|
export function getAsrStatusColor(status: AsrStatus): string {
|
|
const colors: Record<AsrStatus, string> = {
|
|
'no_audio_track': '#999',
|
|
'silent_audio': '#f90',
|
|
'has_transcript': '#0a0',
|
|
'processing': '#59e'
|
|
}
|
|
return colors[status]
|
|
} |