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.

feat: update ETA calculation logic in getGenericEtaI18n function

Tonho71964a9506f3
diff --git a/src/lib/stores/download-store.svelte.ts b/src/lib/stores/download-store.svelte.ts
index 42e03a8a..d10a12e5 100644
--- a/src/lib/stores/download-store.svelte.ts
+++ b/src/lib/stores/download-store.svelte.ts
@@ -325,7 +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.percent <= 0 && item.speed <= 0) return { key: "downloads.eta_calculating" };
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) } };