Skip to content

Open-source download manager & offline media toolbox for YouTube, music, social media, learning platforms & 1,800+ sites. Built with Tauri 2.0, Rust & Svelte.

fix: handle negative percent in ETA calculation for generic downloads

Tonho5eea041c2a6f
diff --git a/src/lib/stores/download-store.svelte.ts b/src/lib/stores/download-store.svelte.ts
index 3706d8ff..42e03a8a 100644
--- a/src/lib/stores/download-store.svelte.ts
+++ b/src/lib/stores/download-store.svelte.ts
@@ -325,6 +325,7 @@ export function getEtaI18n(item: CourseDownloadItem): I18nValue {
}
export function getGenericEtaI18n(item: GenericDownloadItem): I18nValue {
+ if (item.percent < 0) return { key: "downloads.eta_fetching_info" };
if (item.etaSeconds != null && isFinite(item.etaSeconds) && item.etaSeconds >= 0) {
const remaining = item.etaSeconds;
if (remaining < 60) return { key: "downloads.eta_seconds", params: { n: Math.ceil(remaining) } };