Add persistent all-time download counter, session vs total stats
- Track totalDownloadedAllTime in settings (persists across restarts) - Track sessionDownloadedBytes for current app session - Status bar shows both: Session + Gesamt - Statistics section shows Heruntergeladen (Session) + (Gesamt) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
4ea3a75dc0
commit
3c510fc265
@@ -728,6 +728,8 @@ export class DownloadManager extends EventEmitter {
|
||||
|
||||
private speedBytesLastWindow = 0;
|
||||
|
||||
private sessionDownloadedBytes = 0;
|
||||
|
||||
private statsCache: DownloadStats | null = null;
|
||||
|
||||
private statsCacheAt = 0;
|
||||
@@ -911,6 +913,7 @@ export class DownloadManager extends EventEmitter {
|
||||
|
||||
const stats = {
|
||||
totalDownloaded,
|
||||
totalDownloadedAllTime: this.settings.totalDownloadedAllTime,
|
||||
totalFiles,
|
||||
totalPackages: this.session.packageOrder.length,
|
||||
sessionStartedAt: this.session.runStartedAt
|
||||
@@ -4264,6 +4267,8 @@ export class DownloadManager extends EventEmitter {
|
||||
written += buffer.length;
|
||||
windowBytes += buffer.length;
|
||||
this.session.totalDownloadedBytes += buffer.length;
|
||||
this.sessionDownloadedBytes += buffer.length;
|
||||
this.settings.totalDownloadedAllTime += buffer.length;
|
||||
this.itemContributedBytes.set(active.itemId, (this.itemContributedBytes.get(active.itemId) || 0) + buffer.length);
|
||||
this.recordSpeed(buffer.length, item.packageId);
|
||||
throughputWindowBytes += buffer.length;
|
||||
|
||||
Reference in New Issue
Block a user