fix(ytdlp): correct media size estimates

This commit is contained in:
NimBold
2026-06-19 16:41:33 +03:30
parent a2d7b689f3
commit 85df857678
6 changed files with 110 additions and 91 deletions
+2 -1
View File
@@ -35,11 +35,12 @@ export async function initDownloadListener() {
const mainStore = useDownloadStore.getState();
const current = mainStore.downloads.find(d => d.id === payload.id);
if (current) {
const shouldUpdateSize = Boolean(payload.size && (!current.isMedia || payload.size_is_final));
mainStore.updateDownload(payload.id, {
fraction: payload.fraction,
speed: payload.speed,
eta: payload.eta,
...(payload.size ? { size: payload.size } : {}),
...(shouldUpdateSize ? { size: payload.size! } : {}),
});
}
});