From 895906e2f6da3a422c8f05aac7d9d0bad7f5e73c Mon Sep 17 00:00:00 2001 From: Preston Date: Sat, 28 Nov 2020 19:44:17 -0500 Subject: [PATCH] Fix playlist watch video playlist information and fix recommended videos list --- .../watch-video-playlist/watch-video-playlist.js | 14 +++++++++----- .../watch-video-playlist/watch-video-playlist.vue | 2 +- src/renderer/views/Watch/Watch.js | 5 +++-- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/renderer/components/watch-video-playlist/watch-video-playlist.js b/src/renderer/components/watch-video-playlist/watch-video-playlist.js index 5be2cf05..5efdb701 100644 --- a/src/renderer/components/watch-video-playlist/watch-video-playlist.js +++ b/src/renderer/components/watch-video-playlist/watch-video-playlist.js @@ -52,7 +52,11 @@ export default Vue.extend({ currentVideoIndex: function () { const index = this.playlistItems.findIndex((item) => { - return item.id === this.videoId + if (typeof item.videoId !== 'undefined') { + return item.videoId === this.videoId + } else { + return item.id === this.videoId + } }) return index + 1 @@ -280,14 +284,14 @@ export default Vue.extend({ this.playlistTitle = result.title this.playlistItems = result.items this.videoCount = result.total_items - this.channelName = result.author.name - this.channelThumbnail = result.author.avatar - this.channelId = result.author.id + this.channelName = '' // result.author.name + this.channelThumbnail = '' // result.author.avatar + this.channelId = '' // result.author.id this.playlistItems = result.items.filter((video) => { return !(video.title === '[Private video]' || video.title === '[Deleted video]') }).map((video) => { - if (video.author !== null) { + if (typeof video.author !== 'undefined') { const channelName = video.author.name const channelId = video.author.ref.replace(/https:\/\/(www\.)?youtube\.com\/(user|channel)\//g, '') video.author = channelName diff --git a/src/renderer/components/watch-video-playlist/watch-video-playlist.vue b/src/renderer/components/watch-video-playlist/watch-video-playlist.vue index 94b6035f..1981f4e3 100644 --- a/src/renderer/components/watch-video-playlist/watch-video-playlist.vue +++ b/src/renderer/components/watch-video-playlist/watch-video-playlist.vue @@ -69,7 +69,7 @@ >
diff --git a/src/renderer/views/Watch/Watch.js b/src/renderer/views/Watch/Watch.js index aba94c83..8d6316b7 100644 --- a/src/renderer/views/Watch/Watch.js +++ b/src/renderer/views/Watch/Watch.js @@ -202,7 +202,7 @@ export default Vue.extend({ ) this.channelId = result.videoDetails.author.id this.channelName = result.videoDetails.author.name - this.channelThumbnail = result.videoDetails.author.avatar + this.channelThumbnail = result.videoDetails.author.thumbnails[0].url this.videoPublished = new Date(result.videoDetails.publishDate.replace('-', '/')).getTime() this.videoDescription = result.player_response.videoDetails.shortDescription @@ -223,9 +223,10 @@ export default Vue.extend({ this.recommendedVideos = result.related_videos.map((video) => { video.videoId = video.id - video.authorId = video.ucid + video.authorId = video.author.id video.viewCount = video.view_count video.lengthSeconds = video.length_seconds + video.author = video.author.name return video }) if (this.hideVideoLikesAndDislikes) {