debug: add console.log to re-scan flow

- Added logging to ctxReprocess, doReprocess
- Log API call and response for debugging
- Check if reprocessing flag is blocking the action
This commit is contained in:
2026-10-18 23:21:28 +08:00
parent 5e0eac6700
commit 7f6db1a387

View File

@@ -2196,13 +2196,15 @@ async function waitForStable(condition: () => boolean | Promise<boolean>, timeou
async function ctxReprocess(f: any) {
closeContextMenu()
if (reprocessing.value) return
if (reprocessing.value) { console.error('[ctxReprocess] already reprocessing'); return }
console.log('[ctxReprocess] opening confirm dialog for:', f.file_uuid)
confirmTarget.value = { mode: 'reprocess', file: f }
confirmDialog.value = true
}
async function doReprocess(f: any) {
if (reprocessing.value) return
console.log('[doReprocess] called for:', f?.file_uuid, f?.file_name)
if (reprocessing.value) { console.error('[doReprocess] already reprocessing'); return }
if (!f.isRegistered) { actionMsg.value = 'File not registered'; return }
reprocessing.value = true
@@ -2210,9 +2212,12 @@ async function doReprocess(f: any) {
if (!file) {
actionMsg.value = 'File not found in cache'
reprocessing.value = false
console.error('[doReprocess] file not found in cache')
return
}
console.log('[doReprocess] found file, status:', file.status)
const oldStatus = file.status
try {
@@ -2220,10 +2225,12 @@ async function doReprocess(f: any) {
fileStatusCache.value[file.file_uuid] = 'preparing'
actionMsg.value = '🔍 Starting deep scan...'
console.log('[doReprocess] calling re_scan_file API for:', file.file_uuid)
const result = await apiCall('re_scan_file', {
fileUuid: file.file_uuid,
autoPipeline: true
})
console.log('[doReprocess] API response:', JSON.stringify(result))
if (result.success) {
file.status = 'scanning'