From 7e07a44f68b32522be8a3ea76b76b4076b166ea6 Mon Sep 17 00:00:00 2001 From: JellyBrick Date: Mon, 14 Oct 2024 18:27:04 +0900 Subject: [PATCH] fix(downloader): fix #2371 --- src/plugins/downloader/main/index.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/plugins/downloader/main/index.ts b/src/plugins/downloader/main/index.ts index 1d30fe75..ee7fba01 100644 --- a/src/plugins/downloader/main/index.ts +++ b/src/plugins/downloader/main/index.ts @@ -172,6 +172,8 @@ function downloadSongOnFinishSetup({ let duration: number | undefined; let time = 0; + const defaultDownloadFolder = app.getPath('downloads'); + registerCallback((songInfo: SongInfo) => { if ( !songInfo.isPaused && @@ -185,7 +187,9 @@ function downloadSongOnFinishSetup({ ) { downloadSong( currentUrl, - config.downloadOnFinish.folder ?? config.downloadFolder, + config.downloadOnFinish.folder ?? + config.downloadFolder ?? + defaultDownloadFolder, ); } else if ( config.downloadOnFinish.mode === 'percent' && @@ -193,7 +197,9 @@ function downloadSongOnFinishSetup({ ) { downloadSong( currentUrl, - config.downloadOnFinish.folder ?? config.downloadFolder, + config.downloadOnFinish.folder ?? + config.downloadFolder ?? + defaultDownloadFolder, ); } }