diff --git a/src/renderer/components/playlist-info/playlist-info.css b/src/renderer/components/playlist-info/playlist-info.css index a848c049..7139aa93 100644 --- a/src/renderer/components/playlist-info/playlist-info.css +++ b/src/renderer/components/playlist-info/playlist-info.css @@ -4,6 +4,8 @@ .playlistThumbnail img { width: 100%; + + cursor: pointer; } .playlistChannel { diff --git a/src/renderer/components/playlist-info/playlist-info.js b/src/renderer/components/playlist-info/playlist-info.js index ec916a89..d94b3599 100644 --- a/src/renderer/components/playlist-info/playlist-info.js +++ b/src/renderer/components/playlist-info/playlist-info.js @@ -3,7 +3,7 @@ import { mapActions } from 'vuex' import FtListDropdown from '../ft-list-dropdown/ft-list-dropdown.vue' export default Vue.extend({ - name: 'FtElementList', + name: 'PlaylistInfo', components: { 'ft-list-dropdown': FtListDropdown }, @@ -16,7 +16,7 @@ export default Vue.extend({ data: function () { return { id: '', - randomVideoId: '', + firstVideoId: '', title: '', channelThumbnail: '', channelName: '', @@ -59,20 +59,20 @@ export default Vue.extend({ thumbnail: function () { switch (this.thumbnailPreference) { case 'start': - return `https://i.ytimg.com/vi/${this.randomVideoId}/mq1.jpg` + return `https://i.ytimg.com/vi/${this.firstVideoId}/mq1.jpg` case 'middle': - return `https://i.ytimg.com/vi/${this.randomVideoId}/mq2.jpg` + return `https://i.ytimg.com/vi/${this.firstVideoId}/mq2.jpg` case 'end': - return `https://i.ytimg.com/vi/${this.randomVideoId}/mq3.jpg` + return `https://i.ytimg.com/vi/${this.firstVideoId}/mq3.jpg` default: - return `https://i.ytimg.com/vi/${this.randomVideoId}/mqdefault.jpg` + return `https://i.ytimg.com/vi/${this.firstVideoId}/mqdefault.jpg` } } }, mounted: function () { console.log(this.data) this.id = this.data.id - this.randomVideoId = this.data.randomVideoId + this.firstVideoId = this.data.firstVideoId this.title = this.data.title this.channelName = this.data.channelName this.channelThumbnail = this.data.channelThumbnail @@ -113,6 +113,19 @@ export default Vue.extend({ } }, + playFirstVideo() { + const playlistInfo = { + playlistId: this.id + } + + this.$router.push( + { + path: `/watch/${this.firstVideoId}`, + query: playlistInfo + } + ) + }, + goToChannel: function () { this.$router.push({ path: `/channel/${this.channelId}` }) }, diff --git a/src/renderer/components/playlist-info/playlist-info.vue b/src/renderer/components/playlist-info/playlist-info.vue index 889dfefa..dc4aa851 100644 --- a/src/renderer/components/playlist-info/playlist-info.vue +++ b/src/renderer/components/playlist-info/playlist-info.vue @@ -5,6 +5,7 @@ >