feat: media API (video/bbox/thumbnail), UUID unification, dot matrix text, portal fixes, API dictionary V1.3
This commit is contained in:
@@ -373,7 +373,7 @@ export async function getVideos(
|
||||
params.append('page', String(page))
|
||||
params.append('page_size', String(page_size))
|
||||
|
||||
return httpFetch(`${config.api_base_url}/api/v1/videos?${params.toString()}`)
|
||||
return httpFetch(`${config.api_base_url}/api/v1/files?${params.toString()}`)
|
||||
}
|
||||
|
||||
export async function listIdentities(uuid?: string): Promise<any> {
|
||||
@@ -419,20 +419,18 @@ export async function getPersonThumbnail(personId: string): Promise<string> {
|
||||
if (isTauri()) {
|
||||
return tauriInvoke<string>('get_person_thumbnail_b64', { person_id: personId })
|
||||
}
|
||||
|
||||
const config = getConfig()
|
||||
return `${config.api_base_url}/api/v1/people/${personId}/thumbnail`
|
||||
return `${config.api_base_url}/api/v1/file/:file_uuid/faces/:face_id/thumbnail`
|
||||
}
|
||||
|
||||
export async function registerIdentity(name: string, images: string[]): Promise<any> {
|
||||
if (isTauri()) {
|
||||
return tauriInvoke('register_identity', { name, images })
|
||||
}
|
||||
|
||||
const config = getConfig()
|
||||
return httpFetch(`${config.api_base_url}/api/v1/identities/from-person`, {
|
||||
return httpFetch(`${config.api_base_url}/api/v1/identity`, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ name, images }),
|
||||
body: JSON.stringify({ face_json_path: images[0] || '', identity_name: name }),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -440,10 +438,9 @@ export async function processVideo(uuid: string, processors?: string[]): Promise
|
||||
if (isTauri()) {
|
||||
return tauriInvoke('process_video', { uuid, processors })
|
||||
}
|
||||
|
||||
const config = getConfig()
|
||||
const body = processors ? { processors } : {}
|
||||
return httpFetch(`${config.api_base_url}/api/v1/assets/${uuid}/process`, {
|
||||
return httpFetch(`${config.api_base_url}/api/v1/file/${uuid}/process`, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(body),
|
||||
})
|
||||
@@ -453,7 +450,6 @@ export async function registerVideo(filePath: string): Promise<RegisterResponse>
|
||||
if (isTauri()) {
|
||||
return tauriInvoke<RegisterResponse>('register_video', { file_path: filePath })
|
||||
}
|
||||
|
||||
const config = getConfig()
|
||||
return httpFetch<RegisterResponse>(`${config.api_base_url}/api/v1/files/register`, {
|
||||
method: 'POST',
|
||||
@@ -465,10 +461,10 @@ export async function unregisterVideo(fileUuid: string): Promise<UnregisterRespo
|
||||
if (isTauri()) {
|
||||
return tauriInvoke<UnregisterResponse>('unregister_video', { file_uuid: fileUuid })
|
||||
}
|
||||
|
||||
const config = getConfig()
|
||||
return httpFetch<UnregisterResponse>(`${config.api_base_url}/api/v1/videos/${fileUuid}`, {
|
||||
method: 'DELETE',
|
||||
return httpFetch<UnregisterResponse>(`${config.api_base_url}/api/v1/files/unregister`, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ file_uuid: fileUuid }),
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user