fix(download): persist resume sessions (#137)

* fix(download): persist resume sessions

* fix(ipc): cleanup download listeners
This commit is contained in:
Nexmoe
2026-01-17 13:00:36 +08:00
committed by GitHub
parent 73af211bef
commit 894eb9774b
11 changed files with 380 additions and 88 deletions

View File

@@ -449,14 +449,20 @@ app.whenReady().then(async () => {
}
// Initialize yt-dlp
let ytdlpReady = false
try {
log.info('Initializing yt-dlp...')
await ytdlpManager.initialize()
ytdlpReady = true
log.info('yt-dlp initialized successfully')
} catch (error) {
log.error('Failed to initialize yt-dlp:', error)
}
if (ytdlpReady) {
downloadEngine.restoreActiveDownloads()
}
await startExtensionApiServer()
applyDockVisibility(settingsManager.get('hideDockIcon'))
@@ -494,6 +500,7 @@ app.whenReady().then(async () => {
app.on('before-quit', () => {
isQuitting = true
downloadEngine.flushDownloadSession()
})
// Quit when all windows are closed, except on macOS. There, it's common