mirror of
https://github.com/VueTubeApp/VueTube
synced 2024-11-26 05:05:23 +00:00
channel channels
This commit is contained in:
parent
329fa35707
commit
c4bd494677
3 changed files with 35 additions and 4 deletions
|
@ -36,8 +36,7 @@
|
|||
<div
|
||||
v-for="title in video.title.runs"
|
||||
:key="title.text"
|
||||
style="margin-top: 0.5em"
|
||||
class="vid-title"
|
||||
class="vid-title mt-1"
|
||||
>
|
||||
{{ title.text }}
|
||||
</div>
|
||||
|
|
|
@ -1,3 +1,21 @@
|
|||
<template>
|
||||
<div></div>
|
||||
<div class="pt-4">
|
||||
<v-list-item
|
||||
v-for="(channel, index) in $store.state.channel.featuredChannels"
|
||||
:key="index"
|
||||
class="pa-0 min-height-0"
|
||||
>
|
||||
<compact-channel-renderer
|
||||
:video="channel.gridChannelRenderer"
|
||||
></compact-channel-renderer>
|
||||
</v-list-item>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import compactChannelRenderer from "../../components/CompactRenderers/compactChannelRenderer.vue";
|
||||
|
||||
export default {
|
||||
components: { compactChannelRenderer },
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -10,6 +10,7 @@ const getDefaultState = () => {
|
|||
descriptionPreview: null,
|
||||
subscribers: null,
|
||||
videosCount: null,
|
||||
featuredChannels: null,
|
||||
};
|
||||
};
|
||||
export const state = () => {
|
||||
|
@ -25,7 +26,7 @@ export const actions = {
|
|||
this.$youtube
|
||||
.getChannel(channelRequest)
|
||||
.then((channel) => {
|
||||
console.log(channel);
|
||||
// console.log(channel);
|
||||
state.loading = false;
|
||||
state.banner =
|
||||
channel.header.channelMobileHeaderRenderer.channelHeader.elementRenderer.newElement.type.componentType.model.channelHeaderModel.channelBanner?.image.sources[0].url;
|
||||
|
@ -43,6 +44,19 @@ export const actions = {
|
|||
channel.header.channelMobileHeaderRenderer.channelHeader.elementRenderer.newElement.type.componentType.model.channelHeaderModel.channelProfile.metadata.subscriberCountText;
|
||||
state.videosCount =
|
||||
channel.header.channelMobileHeaderRenderer.channelHeader.elementRenderer.newElement.type.componentType.model.channelHeaderModel.channelProfile.metadata.videosCountText;
|
||||
const featuredSection =
|
||||
channel.contents.singleColumnBrowseResultsRenderer.tabs[0].tabRenderer.content.sectionListRenderer.contents.find(
|
||||
(i) => {
|
||||
return !!i?.shelfRenderer?.content?.horizontalListRenderer
|
||||
?.items[0].gridChannelRenderer;
|
||||
}
|
||||
);
|
||||
console.log("CHANNEL INDEX");
|
||||
console.log(featuredSection);
|
||||
state.featuredChannels =
|
||||
featuredSection.shelfRenderer.content.horizontalListRenderer.items;
|
||||
console.log("ITEMS ITEMS");
|
||||
console.log(state.featuredChannels);
|
||||
})
|
||||
.catch((err) => {
|
||||
state.loading = false;
|
||||
|
|
Loading…
Reference in a new issue