Fix playlist watch video playlist information and fix recommended videos list

This commit is contained in:
Preston 2020-11-28 19:44:17 -05:00
parent fdb258b4e3
commit 895906e2f6
3 changed files with 13 additions and 8 deletions

View File

@ -52,7 +52,11 @@ export default Vue.extend({
currentVideoIndex: function () {
const index = this.playlistItems.findIndex((item) => {
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

View File

@ -69,7 +69,7 @@
>
<div class="videoIndexContainer">
<font-awesome-icon
v-if="item.id === videoId"
v-if="currentVideoIndex === (index + 1)"
class="videoIndexIcon"
icon="play"
/>

View File

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