From 352221ebae08833d22dbf6726830e5c4a5b09da4 Mon Sep 17 00:00:00 2001 From: Thomas Piccirello Date: Sun, 8 Jun 2025 22:43:54 -0700 Subject: [PATCH] Fix metadata calculation when folder size is 0 --- src/webui/www/private/scripts/file-tree.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/webui/www/private/scripts/file-tree.js b/src/webui/www/private/scripts/file-tree.js index c426279cc..e225cb297 100644 --- a/src/webui/www/private/scripts/file-tree.js +++ b/src/webui/www/private/scripts/file-tree.js @@ -213,8 +213,8 @@ window.qBittorrent.FileTree ??= (() => { } root.checked = root.autoCalculateCheckedState ? root.checked : TriState.Checked; - root.progress /= root.size; - root.availability /= root.size; + root.progress = (root.size > 0) ? (root.progress / root.size) : 0; + root.availability = (root.size > 0) ? (root.availability / root.size) : 0; } stack.pop();