Skip to content

Commit

Permalink
Display playlist panel for videos played from homepage
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-niles authored and benoit74 committed Jul 1, 2024
1 parent 6689f98 commit cbc2633
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion zimui/src/components/channel/tabs/VideosTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,5 @@ onMounted(() => {
:count-text="playlist?.videos.length === 1 ? 'video' : 'videos'"
icon="mdi-video-outline"
/>
<video-grid v-if="videos" :videos="videos" />
<video-grid v-if="videos" :videos="videos" :playlist-slug="main.channel?.mainPlaylist" />
</template>
9 changes: 8 additions & 1 deletion zimui/src/components/video/VideoCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const { smAndDown } = useDisplay()
const props = defineProps<{
video: VideoPreview
playlistSlug?: string
}>()
// Set the maximum length of the title based on the screen size
Expand All @@ -34,7 +35,13 @@ const duration = computed<string>(() => {
</script>

<template>
<router-link :to="{ name: 'watch-video', params: { slug: props.video.slug } }">
<router-link
:to="{
name: 'watch-video',
params: { slug: props.video.slug },
query: { list: props.playlistSlug }
}"
>
<v-card flat class="mx-4">
<v-row no-gutters>
<v-col cols="5" md="12">
Expand Down
3 changes: 2 additions & 1 deletion zimui/src/components/video/VideoGrid.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const { mdAndDown } = useDisplay()
const props = defineProps<{
videos: VideoPreview[]
playlistSlug?: string
}>()
</script>

Expand All @@ -23,7 +24,7 @@ const props = defineProps<{
xxl="1"
class="mb-2 mb-md-6"
>
<video-card :video="video" />
<video-card :video="video" :playlist-slug="playlistSlug" />
</v-col>
</v-row>
</v-container>
Expand Down

0 comments on commit cbc2633

Please sign in to comment.