From 593b83d61a7ff4f8ee2cbeb120006a7a01a4ab92 Mon Sep 17 00:00:00 2001 From: Momentry Studio Date: Thu, 8 Oct 2026 01:00:24 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E6=89=B9=E9=87=8F=20Deep=20Scan=20?= =?UTF-8?q?=E5=B9=B6=E5=8F=91=E6=95=B0=E6=94=B9=E4=B8=BA=202=EF=BC=8C?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=8E=92=E9=98=9F=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改: - maxConcurrent 从 3 改为 2 - 开始时显示:"Starting: 2 immediate, 3 queuing..." - 处理时显示:"Processing 1/5" 或 "Processing 3/5 (1 queuing)..." - 更清晰的队列状态显示 --- src/views/LibraryView.vue | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/views/LibraryView.vue b/src/views/LibraryView.vue index 2e90d2d..60849be 100644 --- a/src/views/LibraryView.vue +++ b/src/views/LibraryView.vue @@ -1887,14 +1887,16 @@ async function batchDeepScan() { if (!confirm(`Deep scan ${filesToProcess.length} files?\n\nThis will process all selected files with default settings.`)) return batchProcessing.value = true - actionMsg.value = `Starting deep scan for ${filesToProcess.length} files...` - const maxConcurrent = 3 + const maxConcurrent = 2 const limit = pLimit(maxConcurrent) + const immediateCount = Math.min(filesToProcess.length, maxConcurrent) + const queueTotal = Math.max(0, filesToProcess.length - maxConcurrent) + + actionMsg.value = `Starting: ${immediateCount} immediate, ${queueTotal} queuing...` let successCount = 0 let failCount = 0 - let queueCount = 0 const tasks = filesToProcess.map((f, index) => { return limit(async () => { @@ -1905,9 +1907,10 @@ async function batchDeepScan() { } const position = index + 1 - if (position > maxConcurrent) { - queueCount++ - actionMsg.value = `Processing ${successCount + 1}/${filesToProcess.length} (${queueCount} in queue)...` + const queuePosition = position - maxConcurrent + + if (queuePosition > 0) { + actionMsg.value = `Processing ${successCount + 1}/${filesToProcess.length} (${queuePosition} queuing)...` } else { actionMsg.value = `Processing ${position}/${filesToProcess.length}...` }