fix: use vlm_description_localized field name from Core API

- Changed vlm_description_lang to vlm_description_localized
- Core API outputs vlm_description (EN) + vlm_description_localized (JA)
- Frontend shows localized first: 【JA】...【English】...
This commit is contained in:
2026-10-23 04:56:56 +08:00
parent 1ffceaba26
commit 76d9afd43b

View File

@@ -1127,7 +1127,7 @@ async function sendMessage() {
return {
...sEn,
vlm_description_en: sEn.vlm_description || '',
vlm_description_lang: sLang?.vlm_description || '',
vlm_description_localized: sLang?.vlm_description || '',
vlm_description: sEn.vlm_description || ''
}
})
@@ -1138,7 +1138,7 @@ async function sendMessage() {
return {
...tEn,
vlm_description_en: tEn.vlm_description || '',
vlm_description_lang: tLang?.vlm_description || '',
vlm_description_localized: tLang?.vlm_description || '',
vlm_description: tEn.vlm_description || ''
}
})
@@ -1182,14 +1182,14 @@ async function sendMessage() {
let vlmDesc = s.vlm_description || ''
let textContent = vlmDesc
if (bilingual && s.vlm_description_en && s.vlm_description_lang) {
if (bilingual && s.vlm_description_en && s.vlm_description_localized) {
// Show localized language first, then English
textContent = `【${outputLang.toUpperCase()}】\n${s.vlm_description_lang}\n\n【English】\n${s.vlm_description_en}`
vlmDesc = s.vlm_description_lang
} else if (bilingual && s.vlm_description_lang) {
textContent = `【${outputLang.toUpperCase()}】\n${s.vlm_description_localized}\n\n【English】\n${s.vlm_description_en}`
vlmDesc = s.vlm_description_localized
} else if (bilingual && s.vlm_description_localized) {
// Only localized language available
textContent = `【${outputLang.toUpperCase()}】\n${s.vlm_description_lang}`
vlmDesc = s.vlm_description_lang
textContent = `【${outputLang.toUpperCase()}】\n${s.vlm_description_localized}`
vlmDesc = s.vlm_description_localized
} else if (bilingual && s.vlm_description_en) {
// Only English available
textContent = `【English】\n${s.vlm_description_en}`
@@ -1210,7 +1210,7 @@ async function sendMessage() {
thumbnail_url: `${base}/api/v1/file/${s.file_uuid}/scenes/scene_${String(sceneIndex).padStart(3, '0')}.jpg`,
bilingual,
vlm_description_en: s.vlm_description_en,
vlm_description_lang: s.vlm_description_lang
vlm_description_localized: s.vlm_description_localized
}
})
@@ -1225,14 +1225,14 @@ async function sendMessage() {
let vlmDesc = t.vlm_description || ''
let textContent = vlmDesc
if (bilingual && t.vlm_description_en && t.vlm_description_lang) {
if (bilingual && t.vlm_description_en && t.vlm_description_localized) {
// Show localized language first, then English
textContent = `【${outputLang.toUpperCase()}】\n${t.vlm_description_lang}\n\n【English】\n${t.vlm_description_en}`
vlmDesc = t.vlm_description_lang
} else if (bilingual && t.vlm_description_lang) {
textContent = `【${outputLang.toUpperCase()}】\n${t.vlm_description_localized}\n\n【English】\n${t.vlm_description_en}`
vlmDesc = t.vlm_description_localized
} else if (bilingual && t.vlm_description_localized) {
// Only localized language available
textContent = `【${outputLang.toUpperCase()}】\n${t.vlm_description_lang}`
vlmDesc = t.vlm_description_lang
textContent = `【${outputLang.toUpperCase()}】\n${t.vlm_description_localized}`
vlmDesc = t.vlm_description_localized
} else if (bilingual && t.vlm_description_en) {
// Only English available
textContent = `【English】\n${t.vlm_description_en}`
@@ -1252,7 +1252,7 @@ async function sendMessage() {
similarity: t.score ?? null,
bilingual,
vlm_description_en: t.vlm_description_en,
vlm_description_lang: t.vlm_description_lang
vlm_description_localized: t.vlm_description_localized
}
})
@@ -1354,12 +1354,12 @@ async function loadMore() {
let vlmDesc = s.vlm_description || ''
let textContent = vlmDesc
if (bilingual && s.vlm_description_en && s.vlm_description_lang) {
textContent = `【${outputLang.toUpperCase()}】\n${s.vlm_description_lang}\n\n【English】\n${s.vlm_description_en}`
vlmDesc = s.vlm_description_lang
} else if (bilingual && s.vlm_description_lang) {
textContent = `【${outputLang.toUpperCase()}】\n${s.vlm_description_lang}`
vlmDesc = s.vlm_description_lang
if (bilingual && s.vlm_description_en && s.vlm_description_localized) {
textContent = `【${outputLang.toUpperCase()}】\n${s.vlm_description_localized}\n\n【English】\n${s.vlm_description_en}`
vlmDesc = s.vlm_description_localized
} else if (bilingual && s.vlm_description_localized) {
textContent = `【${outputLang.toUpperCase()}】\n${s.vlm_description_localized}`
vlmDesc = s.vlm_description_localized
} else if (bilingual && s.vlm_description_en) {
textContent = `【English】\n${s.vlm_description_en}`
vlmDesc = s.vlm_description_en
@@ -1380,7 +1380,7 @@ async function loadMore() {
vlm_tags: s.vlm_tags || [],
bilingual,
vlm_description_en: s.vlm_description_en,
vlm_description_lang: s.vlm_description_lang,
vlm_description_localized: s.vlm_description_localized,
search_query: q
}
})
@@ -1389,12 +1389,12 @@ async function loadMore() {
let vlmDesc = t.vlm_description || ''
let textContent = vlmDesc
if (bilingual && t.vlm_description_en && t.vlm_description_lang) {
textContent = `【${outputLang.toUpperCase()}】\n${t.vlm_description_lang}\n\n【English】\n${t.vlm_description_en}`
vlmDesc = t.vlm_description_lang
} else if (bilingual && t.vlm_description_lang) {
textContent = `【${outputLang.toUpperCase()}】\n${t.vlm_description_lang}`
vlmDesc = t.vlm_description_lang
if (bilingual && t.vlm_description_en && t.vlm_description_localized) {
textContent = `【${outputLang.toUpperCase()}】\n${t.vlm_description_localized}\n\n【English】\n${t.vlm_description_en}`
vlmDesc = t.vlm_description_localized
} else if (bilingual && t.vlm_description_localized) {
textContent = `【${outputLang.toUpperCase()}】\n${t.vlm_description_localized}`
vlmDesc = t.vlm_description_localized
} else if (bilingual && t.vlm_description_en) {
textContent = `【English】\n${t.vlm_description_en}`
vlmDesc = t.vlm_description_en
@@ -1412,7 +1412,7 @@ async function loadMore() {
trace_id: t.trace_id,
bilingual,
vlm_description_en: t.vlm_description_en,
vlm_description_lang: t.vlm_description_lang,
vlm_description_localized: t.vlm_description_localized,
search_query: q
}
})