From 59aee0791300c14e8e80bd4872ce0d4b79f8696f Mon Sep 17 00:00:00 2001 From: Nexmoe <16796652+nexmoe@users.noreply.github.com> Date: Fri, 16 Jan 2026 21:58:33 +0800 Subject: [PATCH] fix(download): constrain playlist list height (#130) * fix(download): constrain playlist list height * fix(ci): handle ffmpeg timeout on windows --- scripts/setup-dev-binaries.js | 23 ++++++++++++++----- .../components/download/PlaylistDownload.tsx | 2 +- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/scripts/setup-dev-binaries.js b/scripts/setup-dev-binaries.js index 4d36d52..66dc196 100755 --- a/scripts/setup-dev-binaries.js +++ b/scripts/setup-dev-binaries.js @@ -329,15 +329,21 @@ function formatBytes(bytes) { return `${Math.round(bytes / 1024)} KB` } -function checkBinary(filePath, args, label) { +function checkBinary(filePath, args, label, options = {}) { + const timeoutMs = + typeof options.timeoutMs === 'number' + ? options.timeoutMs + : os.platform() === 'win32' + ? 20000 + : 8000 const result = spawnSync(filePath, args, { encoding: 'utf8', - timeout: 8000, + timeout: timeoutMs, windowsHide: true }) if (result.error) { - return { ok: false, message: result.error.message } + return { ok: false, message: result.error.message, code: result.error.code } } if (result.status !== 0) { @@ -459,10 +465,15 @@ async function downloadFfmpegWindows(config) { fs.copyFileSync(sourcePath, outputPath) const validation = checkBinary(outputPath, ['-version'], 'ffmpeg') if (!validation.ok) { - safeUnlink(outputPath) - throw new Error(`Downloaded ${output} failed version check: ${validation.message}`) + if (validation.code === 'ETIMEDOUT') { + log(`Downloaded ${output} version check timed out; keeping binary`, 'warn') + } else { + safeUnlink(outputPath) + throw new Error(`Downloaded ${output} failed version check: ${validation.message}`) + } + } else { + log(`Downloaded ${output} successfully`, 'success') } - log(`Downloaded ${output} successfully`, 'success') // Cleanup fs.unlinkSync(tempZip) diff --git a/src/renderer/src/components/download/PlaylistDownload.tsx b/src/renderer/src/components/download/PlaylistDownload.tsx index 152ce08..069be4a 100644 --- a/src/renderer/src/components/download/PlaylistDownload.tsx +++ b/src/renderer/src/components/download/PlaylistDownload.tsx @@ -91,7 +91,7 @@ export function PlaylistDownload({ - +
{playlistInfo.entries.map((entry) => { const isSelected = selectedEntryIds.has(entry.id)