Keep session bytes on live update cadence
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user