mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-04 15:14:10 +00:00
fix(video): transcribe archived videos and show progress (#560)
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import type { AssetInfo } from '@shumai/dtos'
|
||||
|
||||
export function getTranscriptVideo(item: AssetInfo) {
|
||||
const isVideo = item.proxyType ? item.proxyType === 'video' : item.mediaType?.startsWith('video/')
|
||||
if (!isVideo) return undefined
|
||||
|
||||
if (item.type === 'version_stack') {
|
||||
const version = item.versionStack?.versions.find(({ current }) => current)
|
||||
if (version) {
|
||||
return {
|
||||
id: version.id,
|
||||
name: version.name || item.name,
|
||||
status: version.status ?? item.status,
|
||||
}
|
||||
}
|
||||
}
|
||||
if (item.type === 'file' && item.id) {
|
||||
return { id: item.id, name: item.name, status: item.status }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user