show member icon for invidious api (#3293)

This commit is contained in:
ChunkyProgrammer 2023-03-14 13:39:40 -04:00 committed by GitHub
parent 94c818148c
commit c37cb95d1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -101,6 +101,10 @@ export async function invidiousGetCommentReplies({ id, replyToken }) {
}
export function youtubeImageUrlToInvidious(url, currentInstance = null) {
if (url == null) {
return null
}
if (currentInstance === null) {
currentInstance = getCurrentInstance()
}
@ -130,6 +134,8 @@ function parseInvidiousCommentData(response) {
comment.numReplies = comment.replies?.replyCount ?? 0
comment.replyToken = comment.replies?.continuation ?? ''
comment.isHearted = comment.creatorHeart !== undefined
comment.isMember = comment.isSponsor
comment.memberIconUrl = youtubeImageUrlToInvidious(comment.sponsorIconUrl)
comment.replies = []
comment.time = toLocalePublicationString({
publishText: comment.publishedText