fix: align uniapp live stream metadata fields
This commit is contained in:
@@ -514,6 +514,16 @@ const awaySubs = computed(() => lineupList.value.filter((p: any) => p.team_side
|
||||
|
||||
const normalizeLiveText = (value: unknown) => String(value || '').trim()
|
||||
|
||||
const getLiveFetchStatusText = (value: unknown) => {
|
||||
const text = normalizeLiveText(value)
|
||||
if (!text) return ''
|
||||
const normalized = text.toLowerCase()
|
||||
if (normalized === 'success' || normalized === '1') return '已抓取'
|
||||
if (normalized === 'pending' || normalized === '0') return '待抓取'
|
||||
if (normalized === 'failed' || normalized === '-1') return '抓取失败'
|
||||
return text
|
||||
}
|
||||
|
||||
const getLiveLineTitle = (item: MatchLiveLineItem) => {
|
||||
return (
|
||||
normalizeLiveText(item?.title) ||
|
||||
@@ -541,8 +551,8 @@ const formatLiveLineUpdate = (value: unknown) => {
|
||||
|
||||
const getLiveLineMeta = (item: MatchLiveLineItem) => {
|
||||
const parts = [
|
||||
normalizeLiveText(item?.status_text) || normalizeLiveText(item?.status_desc) || normalizeLiveText(item?.status),
|
||||
formatLiveLineUpdate(item?.updated_at || item?.update_time),
|
||||
getLiveFetchStatusText(item?.fetch_status),
|
||||
formatLiveLineUpdate(item?.last_fetch_at || item?.update_time),
|
||||
].filter(Boolean)
|
||||
return parts.length ? parts.join(' · ') : '点击选择直播线路'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user