Persist totalDownloadedAllTime across restarts
- Save settings every 30s during active downloads (not just session) - Force settings save on shutdown and run finish - Preserve live totalDownloadedAllTime when user saves settings (app-controller's stale copy no longer overwrites the counter) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
549328893e
commit
bc70ff94cc
@@ -133,6 +133,9 @@ export class AppController {
|
||||
return this.settings;
|
||||
}
|
||||
|
||||
// Preserve the live totalDownloadedAllTime from the download manager
|
||||
const liveSettings = this.manager.getSettings();
|
||||
nextSettings.totalDownloadedAllTime = Math.max(nextSettings.totalDownloadedAllTime || 0, liveSettings.totalDownloadedAllTime || 0);
|
||||
this.settings = nextSettings;
|
||||
saveSettings(this.storagePaths, this.settings);
|
||||
this.manager.setSettings(this.settings);
|
||||
|
||||
Reference in New Issue
Block a user