From db42adf3ff4112dcf9222e73599b7260acebbe21 Mon Sep 17 00:00:00 2001 From: aza547 Date: Wed, 21 Aug 2024 22:37:40 +0100 Subject: [PATCH] fix another download bug --- CHANGELOG.md | 1 + src/main/VideoProcessQueue.ts | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 118eea83..aa57f3fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - [Issue 512](https://github.com/aza547/wow-recorder/issues/512) - Fix a bug where the manager would repeatedly retry configuration if the user got the password wrong. - Fixed an issue where you could not download a video if the cloud upload setting was disabled. +- Fix a bug where downloading the same video twice in a row would fail. ## [5.7.2] - 2024-08-04 ### Fixed diff --git a/src/main/VideoProcessQueue.ts b/src/main/VideoProcessQueue.ts index 9dd38c35..de6f540b 100644 --- a/src/main/VideoProcessQueue.ts +++ b/src/main/VideoProcessQueue.ts @@ -353,7 +353,11 @@ export default class VideoProcessQueue { ), ]); - const metadata = rendererVideoToMetadata(video); + // Spread to force this to be cloned, avoiding modifying the original input, + // which is used again later. This manifested as a bug that prevented us clearing + // the entry from the inProgressDownloads when done, meaning that a repeated + // attempt to download would fail. + const metadata = rendererVideoToMetadata({ ...video }); const videoPath = path.join(storageDir, `${videoName}.mp4`); await writeMetadataFile(videoPath, metadata); } catch (error) {