From 0bc3d98d0b7b0dd657926511455a67804a645984 Mon Sep 17 00:00:00 2001 From: OpenClaw Agent Date: Tue, 10 Feb 2026 17:13:45 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=B7=BB=E5=8A=A0=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E8=A6=86=E7=9B=96=E4=BF=9D=E6=8A=A4=E9=81=BF=E5=85=8D=E5=8E=BB?= =?UTF-8?q?=E9=87=8D=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- skills/bilibili-analyzer/scripts/prepare.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/skills/bilibili-analyzer/scripts/prepare.cs b/skills/bilibili-analyzer/scripts/prepare.cs index c9a28af..370a977 100644 --- a/skills/bilibili-analyzer/scripts/prepare.cs +++ b/skills/bilibili-analyzer/scripts/prepare.cs @@ -393,15 +393,19 @@ async Task DeduplicateFramesAsync(string imagesDir, double threshold) { // Use temp name to avoid conflicts var tempName = Path.Combine(imagesDir, $"temp_{i + 1:D4}.jpg"); + // Delete temp file first if exists + if (File.Exists(tempName)) File.Delete(tempName); File.Move(remainingFiles[i], tempName); } } - // Rename temp files to final names + // Rename temp files to final names (with overwrite support) var tempFiles = Directory.GetFiles(imagesDir, "temp_*.jpg").OrderBy(f => f).ToList(); for (int i = 0; i < tempFiles.Count; i++) { var finalName = Path.Combine(imagesDir, $"frame_{i + 1:D4}.jpg"); + // Delete final file first if exists (fix: overwrite existing file) + if (File.Exists(finalName)) File.Delete(finalName); File.Move(tempFiles[i], finalName); }