fix: handle 404 for scenes endpoint gracefully

- Scenes endpoint may not be implemented in Core API yet
- useVLMScenes returns empty array instead of error on 404
This commit is contained in:
2026-10-23 20:22:48 +08:00
parent e2612dde72
commit 88867e80e5

View File

@@ -61,6 +61,11 @@ export function useVLMScenes(fileUuid: string) {
try {
const base = getApiBase()
const resp = await fetch(`${base}/api/v1/file/${fileUuid}/scenes`)
if (resp.status === 404) {
// Scenes endpoint may not be implemented yet
scenes.value = []
return
}
if (!resp.ok) throw new Error(`HTTP ${resp.status}`)
const data = await resp.json()
scenes.value = Array.isArray(data) ? data : (data.scenes || [])