fix(downloader): fix #2234

This commit is contained in:
JellyBrick
2024-12-27 01:30:09 +09:00
parent 725ad0d630
commit 748d77d1c0

View File

@ -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