2020-02-16 18:30:00 +00:00
|
|
|
import Vue from 'vue'
|
|
|
|
|
|
|
|
export default Vue.extend({
|
|
|
|
name: 'FtListVideo',
|
|
|
|
props: {
|
|
|
|
data: {
|
|
|
|
type: Object,
|
|
|
|
required: true
|
2020-06-23 15:47:19 +00:00
|
|
|
},
|
|
|
|
appearance: {
|
|
|
|
type: String,
|
|
|
|
required: true
|
2020-02-16 18:30:00 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
data: function () {
|
|
|
|
return {
|
|
|
|
playlistLink: '',
|
|
|
|
channelLink: '',
|
|
|
|
title: 'Pop Music Playlist - Timeless Pop Songs (Updated Weekly 2020)',
|
|
|
|
thumbnail: 'https://i.ytimg.com/vi/JGwWNGJdvx8/mqdefault.jpg',
|
|
|
|
channelName: '#RedMusic: Just Hits',
|
|
|
|
videoCount: 200,
|
|
|
|
description: ''
|
|
|
|
}
|
|
|
|
},
|
|
|
|
computed: {
|
2020-10-13 16:17:35 +00:00
|
|
|
invidiousInstance: function () {
|
|
|
|
return this.$store.getters.getInvidiousInstance
|
|
|
|
},
|
|
|
|
|
2020-02-16 18:30:00 +00:00
|
|
|
listType: function () {
|
|
|
|
return this.$store.getters.getListType
|
|
|
|
},
|
|
|
|
|
|
|
|
playlistId: function () {
|
|
|
|
return this.playlistLink.replace('https://www.youtube.com/playlist?list=', '')
|
|
|
|
},
|
|
|
|
|
|
|
|
channelId: function () {
|
|
|
|
let id = this.channelLink.replace('https://www.youtube.com/user/', '')
|
|
|
|
id = id.replace('https://www.youtube.com/channel/', '')
|
|
|
|
return id
|
|
|
|
}
|
|
|
|
},
|
|
|
|
mounted: function () {
|
2020-12-14 04:17:43 +00:00
|
|
|
if (typeof (this.data.owner) === 'object') {
|
2020-02-16 18:30:00 +00:00
|
|
|
this.parseLocalData()
|
|
|
|
} else {
|
|
|
|
this.parseInvidiousData()
|
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
parseInvidiousData: function () {
|
|
|
|
this.title = this.data.title
|
2020-10-13 16:17:35 +00:00
|
|
|
this.thumbnail = this.data.playlistThumbnail.replace('https://i.ytimg.com', this.invidiousInstance).replace('hqdefault', 'mqdefault')
|
2020-02-16 18:30:00 +00:00
|
|
|
this.channelName = this.data.author
|
|
|
|
this.channelLink = this.data.authorUrl
|
|
|
|
this.playlistLink = this.data.playlistId
|
|
|
|
this.videoCount = this.data.videoCount
|
2021-01-11 16:26:14 +00:00
|
|
|
|
|
|
|
if (this.data.proxyThumbnail === false) {
|
|
|
|
this.thumbnail = this.data.playlistThumbnail
|
|
|
|
}
|
2020-02-16 18:30:00 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
parseLocalData: function () {
|
|
|
|
this.title = this.data.title
|
2020-12-14 04:17:43 +00:00
|
|
|
this.thumbnail = this.data.firstVideo.bestThumbnail.url
|
|
|
|
this.channelName = this.data.owner.name
|
|
|
|
this.channelLink = this.data.owner.url
|
|
|
|
this.playlistLink = this.data.url
|
|
|
|
this.videoCount = this.data.length
|
2020-02-16 18:30:00 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|