From 46ffd02b084cd546aa97fed3c982c9e88a30c44b Mon Sep 17 00:00:00 2001 From: Tzahi12345 Date: Tue, 3 Jan 2023 21:33:16 -0500 Subject: [PATCH] Fixed issue where unsubbed subscriptions would continue downloading its videos (#689) --- backend/downloader.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/backend/downloader.js b/backend/downloader.js index c9b93fc..cb2449c 100644 --- a/backend/downloader.js +++ b/backend/downloader.js @@ -156,6 +156,13 @@ async function checkDownloads() { if (max_concurrent_downloads < 0 || running_downloads_count >= max_concurrent_downloads) break; if (waiting_download['finished_step'] && !waiting_download['finished']) { + if (waiting_download['sub_id']) { + const sub_missing = !(await db_api.getRecord('subscriptions', {id: waiting_download['sub_id']})); + if (sub_missing) { + handleDownloadError(waiting_download, `Download failed as subscription with id '${waiting_download['sub_id']}' is missing!`); + continue; + } + } // move to next step running_downloads_count++; if (waiting_download['step_index'] === 0) {