fix: update file index before topic clustering refresh

pull/870/head
wuqinchuan 2026-01-03 14:57:29 +08:00 committed by zanllp
parent c22ac83bde
commit 4287c2c849
1 changed files with 3 additions and 0 deletions

View File

@ -8,6 +8,7 @@ import {
type ClusterIibOutputResp, type ClusterIibOutputResp,
type PromptSearchResp type PromptSearchResp
} from '@/api/db' } from '@/api/db'
import { updateImageData } from '@/api/db'
import { t } from '@/i18n' import { t } from '@/i18n'
import { useGlobalStore } from '@/store/useGlobalStore' import { useGlobalStore } from '@/store/useGlobalStore'
import { computed, onBeforeUnmount, onMounted, ref, watch } from 'vue' import { computed, onBeforeUnmount, onMounted, ref, watch } from 'vue'
@ -201,6 +202,8 @@ const refresh = async () => {
job.value = null job.value = null
jobId.value = '' jobId.value = ''
try { try {
// Ensure DB file index is up to date before clustering (so newly added/moved images are included).
await updateImageData()
const started = await startClusterIibOutputJob({ const started = await startClusterIibOutputJob({
threshold: threshold.value, threshold: threshold.value,
min_cluster_size: minClusterSize.value, min_cluster_size: minClusterSize.value,