diff --git a/backend/app.js b/backend/app.js index fc90c23..e38ecbe 100644 --- a/backend/app.js +++ b/backend/app.js @@ -779,7 +779,9 @@ async function autoUpdateYoutubeDL() { }) .catch(err => { logger.error(`Failed to check ${default_downloader} version for an update.`) - logger.error(err) + logger.error(err); + resolve(false); + return false; }); }); } diff --git a/backend/appdata/default.json b/backend/appdata/default.json index 3a26029..04f76de 100644 --- a/backend/appdata/default.json +++ b/backend/appdata/default.json @@ -13,6 +13,7 @@ "safe_download_override": false, "include_thumbnail": true, "include_metadata": true, + "max_concurrent_downloads": 5, "download_rate_limit": "" }, "Extra": { diff --git a/backend/config.js b/backend/config.js index fe710ac..e50c472 100644 --- a/backend/config.js +++ b/backend/config.js @@ -188,6 +188,7 @@ const DEFAULT_CONFIG = { "safe_download_override": false, "include_thumbnail": true, "include_metadata": true, + "max_concurrent_downloads": 5, "download_rate_limit": "" }, "Extra": { diff --git a/backend/consts.js b/backend/consts.js index ba081c0..1f25021 100644 --- a/backend/consts.js +++ b/backend/consts.js @@ -42,6 +42,10 @@ exports.CONFIG_ITEMS = { 'key': 'ytdl_include_metadata', 'path': 'YoutubeDLMaterial.Downloader.include_metadata' }, + 'ytdl_max_concurrent_downloads': { + 'key': 'ytdl_max_concurrent_downloads', + 'path': 'YoutubeDLMaterial.Downloader.max_concurrent_downloads' + }, 'ytdl_download_rate_limit': { 'key': 'ytdl_download_rate_limit', 'path': 'YoutubeDLMaterial.Downloader.download_rate_limit' diff --git a/backend/downloader.js b/backend/downloader.js index 14e224e..721bc90 100644 --- a/backend/downloader.js +++ b/backend/downloader.js @@ -156,7 +156,8 @@ async function checkDownloads() { const waiting_downloads = downloads.filter(download => !download['paused'] && download['finished_step'] && !download['finished']); for (let i = 0; i < waiting_downloads.length; i++) { const waiting_download = waiting_downloads[i]; - if (running_downloads_count >= 5/*config_api.getConfigItem('ytdl_max_concurrent_downloads')*/) break; + const max_concurrent_downloads = config_api.getConfigItem('ytdl_max_concurrent_downloads'); + if (max_concurrent_downloads < 0 || running_downloads_count >= max_concurrent_downloads) break; if (waiting_download['finished_step'] && !waiting_download['finished']) { // move to next step diff --git a/src/app/components/recent-videos/recent-videos.component.ts b/src/app/components/recent-videos/recent-videos.component.ts index 4f7687f..566bf4e 100644 --- a/src/app/components/recent-videos/recent-videos.component.ts +++ b/src/app/components/recent-videos/recent-videos.component.ts @@ -184,7 +184,7 @@ export class RecentVideosComponent implements OnInit { // normal subscriptions !new_tab ? this.router.navigate(['/player', {uid: file.uid, type: file.isAudio ? 'audio' : 'video', sub_id: sub.id}]) - : window.open(`/#/player;uid=${file.uid};type=${file.isAudio ? 'audio' : 'video'};sub_id=${sub.id}`); + : window.open(`/#/player;uid=${file.uid};type=${file.isAudio ? 'audio' : 'video'}`); } } else { // normal files diff --git a/src/app/components/unified-file-card/unified-file-card.component.ts b/src/app/components/unified-file-card/unified-file-card.component.ts index 205def0..5338cab 100644 --- a/src/app/components/unified-file-card/unified-file-card.component.ts +++ b/src/app/components/unified-file-card/unified-file-card.component.ts @@ -141,10 +141,6 @@ export class UnifiedFileCardComponent implements OnInit { fullLocation += `&jwt=${this.jwtString}`; } - if (this.file_obj['sub_id']) { - fullLocation += `&sub_id=${this.file_obj['sub_id']}`; - } - fullLocation += '&t=,10'; return fullLocation; diff --git a/src/app/settings/settings.component.html b/src/app/settings/settings.component.html index 710b857..e7e0223 100644 --- a/src/app/settings/settings.component.html +++ b/src/app/settings/settings.component.html @@ -178,6 +178,12 @@