From daca715d1b22e5dd2312a8a6ddc4ae6c3234492b Mon Sep 17 00:00:00 2001 From: Isaac Abadi Date: Sun, 20 Sep 2020 23:01:43 -0400 Subject: [PATCH] Fixes bug where playlists could not have download progress tracked - downloads are now treated as playlists for cleaner logic --- backend/app.js | 18 ++++++++++++------ backend/utils.js | 28 ++++++++++++++++++---------- 2 files changed, 30 insertions(+), 16 deletions(-) diff --git a/backend/app.js b/backend/app.js index 38ab93d..d387cfd 100644 --- a/backend/app.js +++ b/backend/app.js @@ -1159,7 +1159,10 @@ async function downloadFileByURL_exec(url, type, options, sessionID = null) { return; } else { // store info in download for future use - download['_filename'] = info['_filename']; + if (Array.isArray(info)) { + download['fileNames'] = []; + for (let info_obj of info) download['fileNames'].push(info_obj['_filename']); + } download['filesize'] = utils.getExpectedFileSize(info); } @@ -1613,12 +1616,15 @@ function checkDownloadPercent(download) { Any file that starts with