mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-04 15:14:10 +00:00
21 lines
630 B
TypeScript
21 lines
630 B
TypeScript
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 }
|
||
|
|
}
|
||
|
|
}
|