Keep session bytes on live update cadence

This commit is contained in:
Sucukdeluxe
2026-08-31 15:56:04 +02:00
parent 9ca5789627
commit 1580a160da
4 changed files with 32 additions and 4 deletions
+7 -4
View File
@@ -2853,10 +2853,13 @@ export class DownloadManager extends EventEmitter {
}
public getStats(now = nowMs()): DownloadStats {
const itemCount = this.itemCount;
if (this.statsCache && this.session.running && itemCount >= 500 && now - this.statsCacheAt < 1500) {
return this.statsCache;
}
const itemCount = this.itemCount;
if (this.statsCache && this.session.running && itemCount >= 500 && now - this.statsCacheAt < 1500) {
return {
...this.statsCache,
totalDownloaded: this.sessionDownloadedBytes
};
}
this.resetSessionTotalsIfQueueEmpty();