handle video tagging
This commit is contained in:
@@ -378,6 +378,19 @@ export default function MixedView({ libraryId, initialPath }: Props) {
|
||||
onClose={() => setModal(null)}
|
||||
onPrev={modal.mediaIndex > 0 ? () => navigateModal(-1) : undefined}
|
||||
onNext={modal.mediaIndex < mediaEntries.length - 1 ? () => navigateModal(1) : undefined}
|
||||
onAiTag={modal.itemKey ? async () => {
|
||||
const res = await fetch('/api/ai-tagging', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ itemKey: modal.itemKey }),
|
||||
})
|
||||
if (!res.ok) {
|
||||
const data = await res.json().catch(() => ({}))
|
||||
throw new Error((data as { error?: string }).error ?? 'AI tagging failed')
|
||||
}
|
||||
fetchAssignments()
|
||||
setFilterRefreshKey((k) => k + 1)
|
||||
} : undefined}
|
||||
/>
|
||||
)}
|
||||
{modal?.type === 'image' && (
|
||||
|
||||
Reference in New Issue
Block a user