From 748d77d1c06cccaf0c3bdc4e5e72610fab19f87c Mon Sep 17 00:00:00 2001 From: JellyBrick Date: Fri, 27 Dec 2024 01:30:09 +0900 Subject: [PATCH] fix(downloader): fix #2234 --- src/plugins/downloader/main/index.ts | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/plugins/downloader/main/index.ts b/src/plugins/downloader/main/index.ts index 92d47b18..1526c826 100644 --- a/src/plugins/downloader/main/index.ts +++ b/src/plugins/downloader/main/index.ts @@ -590,20 +590,17 @@ export async function downloadPlaylist(givenUrl?: string | URL) { return; } - if ( - !playlist || - !playlist.items || - playlist.items.length === 0 || - !playlist.header || - !('title' in playlist.header) - ) { + if (!playlist || !playlist.items || playlist.items.length === 0) { sendError( new Error(t('plugins.downloader.backend.feedback.playlist-is-empty')), ); return; } - const normalPlaylistTitle = playlist.header?.title?.text; + const normalPlaylistTitle = + playlist.header && 'title' in playlist.header + ? playlist.header?.title?.text + : undefined; const playlistTitle = normalPlaylistTitle ?? playlist.page.contents_memo