2022-03-16 00:31:03 +00:00
|
|
|
<template>
|
2022-03-19 19:31:43 +00:00
|
|
|
<!--
|
|
|
|
* Videos are now polled from '~/components/recommended.vue'
|
|
|
|
* This is to allow use of "recommended" videos on other pages such as /watch
|
|
|
|
* -Front
|
|
|
|
* -->
|
2022-03-24 11:47:13 +00:00
|
|
|
|
|
|
|
<div>
|
|
|
|
<!-- Video Loading Animation -->
|
2022-03-31 02:22:22 +00:00
|
|
|
<vid-load-renderer v-if="!recommends.contents" />
|
|
|
|
<horizontal-list-renderer v-else :render="recommends.contents[0]" />
|
2022-03-24 11:47:13 +00:00
|
|
|
</div>
|
2022-03-20 09:50:13 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2022-03-24 20:46:17 +00:00
|
|
|
import horizontalListRenderer from "~/components/ListRenderers/horizontalListRenderer.vue";
|
|
|
|
import VidLoadRenderer from "~/components/vidLoadRenderer.vue";
|
2022-03-20 09:50:13 +00:00
|
|
|
export default {
|
2022-03-24 11:47:13 +00:00
|
|
|
components: { horizontalListRenderer, VidLoadRenderer },
|
2022-03-24 04:28:57 +00:00
|
|
|
|
|
|
|
computed: {
|
|
|
|
recommends: {
|
|
|
|
get() {
|
|
|
|
return this.$store.state.recommendedVideos;
|
|
|
|
},
|
|
|
|
set(val) {
|
|
|
|
this.$store.commit("updateRecommendedVideos", val);
|
|
|
|
},
|
|
|
|
},
|
2022-03-20 09:50:13 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
mounted() {
|
2022-03-27 05:00:09 +00:00
|
|
|
if (!this.recommends.items || !this.recommends.items.length) {
|
2022-03-24 04:28:57 +00:00
|
|
|
this.$youtube
|
|
|
|
.recommend()
|
|
|
|
.then((result) => {
|
2022-03-31 02:22:22 +00:00
|
|
|
if (result) this.recommends = result;
|
2022-03-24 04:28:57 +00:00
|
|
|
})
|
|
|
|
.catch((error) => this.$logger("Home Page", error, true));
|
|
|
|
}
|
2022-03-20 09:50:13 +00:00
|
|
|
},
|
|
|
|
};
|
2022-03-21 23:47:11 +00:00
|
|
|
</script>
|