Properly show live and upcoming videos in playlists and up next (#3250)

This commit is contained in:
absidue 2023-03-05 17:20:32 +01:00 committed by GitHub
parent 65d1d6b09e
commit 1335604554
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 4 deletions

View File

@ -311,7 +311,10 @@ export function parseLocalPlaylistVideo(video) {
title: video.title.text,
author: video.author.name,
authorId: video.author.id,
lengthSeconds: isNaN(video.duration.seconds) ? '' : video.duration.seconds
lengthSeconds: isNaN(video.duration.seconds) ? '' : video.duration.seconds,
liveNow: video.is_live,
isUpcoming: video.is_upcoming,
premiereDate: video.upcoming
}
}
@ -400,10 +403,10 @@ export function parseLocalWatchNextVideo(video) {
author: video.author.name,
authorId: video.author.id,
viewCount: extractNumberFromString(video.view_count.text),
// CompactVideo doesn't have is_live, is_upcoming or is_premiere,
// so we have to make do with this for the moment, to stop toLocalePublicationString erroring
publishedText: video.published.text === 'N/A' ? null : video.published.text,
lengthSeconds: isNaN(video.duration.seconds) ? '' : video.duration.seconds
lengthSeconds: isNaN(video.duration.seconds) ? '' : video.duration.seconds,
liveNow: video.is_live,
isUpcoming: video.is_premiere
}
}