From 82917100494eb8ac5a92d06fbc0dddadac986cef Mon Sep 17 00:00:00 2001 From: clover caruso Date: Wed, 15 Oct 2025 23:36:01 -0700 Subject: [PATCH] chore: migrate progress breaking changes --- lib/subprocess/ffmpeg.ts | 8 ++++---- src/file-viewer/bin/file-scan.ts | 18 +++++++++--------- src/file-viewer/rsync.ts | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/subprocess/ffmpeg.ts b/lib/subprocess/ffmpeg.ts index 9e8db036318bf0adb8a8f3088c9fabf474023f3e..0db0986748f05dbb5c6568d667ba30836a75c2de 100644 --- a/lib/subprocess/ffmpeg.ts +++ b/lib/subprocess/ffmpeg.ts @@ -38,7 +38,7 @@ export async function spawn(options: SpawnOptions) { if (!running) return; const { frame, totalFrames, fps, speed } = result; node.value = frame; - node.estimate = totalFrames; + node.total = totalFrames; const extras = [ `${fps} fps`, speed, @@ -147,7 +147,7 @@ export class Parse { const [h, m, s] = match.slice(1).map((x) => Number(x)); this.durationTime = Math.max( this.durationTime, - h * 60 * 60 + m * 60 + s, + h! * 60 * 60 + m! * 60 + s!, ); } if (!this.targetFps) { @@ -174,8 +174,8 @@ export class Parse { const hlsMatch = line.match(/.*Opening '(.+)' for writing/); if (hlsMatch) { - if (!hlsMatch[1].endsWith(".tmp")) { - this.hlsFile = path.basename(hlsMatch[1]); + if (!hlsMatch[1]!.endsWith(".tmp")) { + this.hlsFile = path.basename(hlsMatch[1]!); } return { kind: "ignore" }; } diff --git a/src/file-viewer/bin/file-scan.ts b/src/file-viewer/bin/file-scan.ts index 80dd9e8a514784983b4fd331547f6bcbc9b5e983..433ee231296740ff46489cf2d39fb40c00e5791d 100644 --- a/src/file-viewer/bin/file-scan.ts +++ b/src/file-viewer/bin/file-scan.ts @@ -23,9 +23,9 @@ export async function main() { const walkQueue = new queue.PriorityQueue(10); - const dirsNode = progress.start("Walk Tree", { estimate: 1 }); + const dirsNode = progress.start("Walk Tree", { total: 1 }); dirsNode.passive = true; - const fileNode = progress.start("Process File", { estimate: 0 }); + const fileNode = progress.start("Process File", { total: 0 }); fileNode.sortChildren = (a, b) => { const ac = a.children.length > 0 ? 1 : 0; const bc = b.children.length > 0 ? 1 : 0; @@ -251,8 +251,8 @@ export async function main() { if (job.needs === 0) promises.push(queueFileProcessor(job)); } } - node.estimate = jobs.length; - fileNode.estimate += jobs.length; + node.total = jobs.length; + fileNode.total += jobs.length; for (const job of jobs) { for (const dependId of job.processor.depends) { const dependJob = jobs.find((j) => j.processor.id === dependId); @@ -265,7 +265,7 @@ export async function main() { } } } - if (node.estimate > 0) { + if (node.total > 0) { errorHandler.move(); const parent = mediaFile.getParent(); @@ -669,7 +669,7 @@ const procVideos = transcodeRules.videoFormats.map((preset) => ({ ffmpeg: ffmpegBin!, progress: node, args, - cwd: dir, + cwd: dir.toString(), }); }, }); @@ -700,7 +700,7 @@ const procVideoAudios = transcodeRules.audioFormats.map((preset) => ({ ffmpeg: ffmpegBin!, progress: node, args, - cwd: dir, + cwd: dir.toString(), }); }, }); @@ -752,7 +752,7 @@ const procDash: Process = { ffmpeg: ffmpegBin!, progress: node, args, - cwd: dir, + cwd: dir.toString(), }); }, }); @@ -780,7 +780,7 @@ const procH264Hls: Process = { ffmpeg: ffmpegBin!, progress: node, args, - cwd: dir, + cwd: dir.toString(), }); }, }); diff --git a/src/file-viewer/rsync.ts b/src/file-viewer/rsync.ts index a48b853d7ed443efd19b4fd6c25f15999ed7350d..83b8fb8fa4e0a5daa9186816da67e2a0cf46d74a 100644 --- a/src/file-viewer/rsync.ts +++ b/src/file-viewer/rsync.ts @@ -63,7 +63,7 @@ export async function spawn(options: SpawnOptions) { speed, } = result; node.value = transferNumber; - node.estimate = totalFiles; + node.total = totalFiles; const extras = [ formatSize(bytesTransferred), (totalFiles > filesToCheck) -- 2.54.0