-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #349 from openzim/new-landing-page-ui
Update layout of `Videos` tab in `zimui` to display videos from all playlists in the ZIM
- Loading branch information
Showing
19 changed files
with
582 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
{ | ||
"playlists": [ | ||
{ | ||
"id": "UU8elThf5TGMpQfQc_VE917Q", | ||
"slug": "uploads_from_openzim_testing-917Q", | ||
"author": { | ||
"channelId": "UC8elThf5TGMpQfQc_VE917Q", | ||
"channelTitle": "openZIM_testing", | ||
"channelDescription": "", | ||
"channelJoinedDate": "2024-06-04T13:30:16.232286Z", | ||
"profilePath": "channels/UC8elThf5TGMpQfQc_VE917Q/profile.jpg", | ||
"bannerPath": "channels/UC8elThf5TGMpQfQc_VE917Q/banner.jpg" | ||
}, | ||
"title": "Uploads from openZIM_testing", | ||
"description": "", | ||
"publicationDate": "2024-06-04T14:57:45Z", | ||
"thumbnailPath": "videos/DYvYGQHYScc/video.webp", | ||
"videos": [ | ||
{ | ||
"slug": "coffee_machine-DYvY", | ||
"id": "DYvYGQHYScc", | ||
"title": "Coffee Machine", | ||
"thumbnailPath": "videos/DYvYGQHYScc/video.webp", | ||
"duration": "PT9S" | ||
}, | ||
{ | ||
"slug": "timelapse-9Tgo", | ||
"id": "9TgosbGRsTk", | ||
"title": "Timelapse", | ||
"thumbnailPath": "videos/9TgosbGRsTk/video.webp", | ||
"duration": "PT11S" | ||
} | ||
], | ||
"videosCount": 2 | ||
}, | ||
{ | ||
"id": "PLMK6hZr9PcshJpNSRVaKReGlwhVlh5Gph", | ||
"slug": "trailers-5Gph", | ||
"author": { | ||
"channelId": "UC8elThf5TGMpQfQc_VE917Q", | ||
"channelTitle": "openZIM_testing", | ||
"channelDescription": "", | ||
"channelJoinedDate": "2024-06-04T13:30:16.232286Z", | ||
"profilePath": "channels/UC8elThf5TGMpQfQc_VE917Q/profile.jpg", | ||
"bannerPath": "channels/UC8elThf5TGMpQfQc_VE917Q/banner.jpg" | ||
}, | ||
"title": "Trailers", | ||
"description": "", | ||
"publicationDate": "2024-06-04T15:15:48Z", | ||
"thumbnailPath": "videos/TcMBFSGVi1c/video.webp", | ||
"videos": [ | ||
{ | ||
"slug": "marvel_studios_avengers_endgame_official_trailer-TcMB", | ||
"id": "TcMBFSGVi1c", | ||
"title": "Marvel Studios' Avengers: Endgame - Official Trailer", | ||
"thumbnailPath": "videos/TcMBFSGVi1c/video.webp", | ||
"duration": "PT2M27S" | ||
} | ||
], | ||
"videosCount": 1 | ||
}, | ||
{ | ||
"id": "PLMK6hZr9PcsjcF5mnaQk8Fi-xnb0AQgGI", | ||
"slug": "timelapses-QgGI", | ||
"author": { | ||
"channelId": "UC8elThf5TGMpQfQc_VE917Q", | ||
"channelTitle": "openZIM_testing", | ||
"channelDescription": "", | ||
"channelJoinedDate": "2024-06-04T13:30:16.232286Z", | ||
"profilePath": "channels/UC8elThf5TGMpQfQc_VE917Q/profile.jpg", | ||
"bannerPath": "channels/UC8elThf5TGMpQfQc_VE917Q/banner.jpg" | ||
}, | ||
"title": "Timelapses", | ||
"description": "", | ||
"publicationDate": "2024-06-04T15:04:46Z", | ||
"thumbnailPath": "videos/9TgosbGRsTk/video.webp", | ||
"videos": [ | ||
{ | ||
"slug": "timelapse-9Tgo", | ||
"id": "9TgosbGRsTk", | ||
"title": "Timelapse", | ||
"thumbnailPath": "videos/9TgosbGRsTk/video.webp", | ||
"duration": "PT11S" | ||
}, | ||
{ | ||
"slug": "cloudy_sky_time_lapse_4k_free_footage_video_gopro_11-k02q", | ||
"id": "k02qXOcCrbo", | ||
"title": "Cloudy Sky ☀️ Time Lapse 4K Free Footage Video | GoPro 11", | ||
"thumbnailPath": "videos/k02qXOcCrbo/video.webp", | ||
"duration": "PT36S" | ||
} | ||
], | ||
"videosCount": 2 | ||
}, | ||
{ | ||
"id": "PLMK6hZr9PcsjTJ5u2z-khzvDNXlqdO2wS", | ||
"slug": "coffee-O2wS", | ||
"author": { | ||
"channelId": "UC8elThf5TGMpQfQc_VE917Q", | ||
"channelTitle": "openZIM_testing", | ||
"channelDescription": "", | ||
"channelJoinedDate": "2024-06-04T13:30:16.232286Z", | ||
"profilePath": "channels/UC8elThf5TGMpQfQc_VE917Q/profile.jpg", | ||
"bannerPath": "channels/UC8elThf5TGMpQfQc_VE917Q/banner.jpg" | ||
}, | ||
"title": "Coffee", | ||
"description": "", | ||
"publicationDate": "2024-06-04T15:04:25Z", | ||
"thumbnailPath": "videos/DYvYGQHYScc/video.webp", | ||
"videos": [ | ||
{ | ||
"slug": "coffee_machine-DYvY", | ||
"id": "DYvYGQHYScc", | ||
"title": "Coffee Machine", | ||
"thumbnailPath": "videos/DYvYGQHYScc/video.webp", | ||
"duration": "PT9S" | ||
} | ||
], | ||
"videosCount": 1 | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<script setup lang="ts"> | ||
import { ref, onMounted, watch } from 'vue' | ||
import { useMainStore } from '@/stores/main' | ||
import type { VideoPreview } from '@/types/Videos' | ||
import VideoGrid from '@/components/video/VideoGrid.vue' | ||
import TabInfo from '@/components/common/ViewInfo.vue' | ||
import type { Playlist } from '@/types/Playlists' | ||
const main = useMainStore() | ||
const videos = ref<VideoPreview[]>([]) | ||
const playlist = ref<Playlist>() | ||
const isLoading = ref(true) | ||
// Watch for changes in the main playlist | ||
watch( | ||
() => main.channel?.mainPlaylist, | ||
() => { | ||
fetchData() | ||
} | ||
) | ||
// Fetch the videos for the main playlist | ||
const fetchData = async function () { | ||
if (main.channel?.mainPlaylist) { | ||
try { | ||
const resp = await main.fetchPlaylist(main.channel?.mainPlaylist) | ||
if (resp) { | ||
playlist.value = resp | ||
videos.value = resp.videos | ||
isLoading.value = false | ||
} | ||
} catch (error) { | ||
main.setErrorMessage('An unexpected error occured when fetching videos.') | ||
} | ||
} | ||
} | ||
// Fetch the data on component mount | ||
onMounted(() => { | ||
fetchData() | ||
}) | ||
</script> | ||
|
||
<template> | ||
<div v-if="isLoading" class="container mt-8 d-flex justify-center"> | ||
<v-progress-circular class="d-inline" indeterminate></v-progress-circular> | ||
</div> | ||
<div v-else> | ||
<tab-info | ||
:title="playlist?.title || 'Main Playlist'" | ||
:count="playlist?.videosCount || 0" | ||
:count-text="playlist?.videos.length === 1 ? 'video' : 'videos'" | ||
icon="mdi-video-outline" | ||
/> | ||
<video-grid v-if="videos" :videos="videos" :playlist-slug="main.channel?.mainPlaylist" /> | ||
</div> | ||
</template> |
Oops, something went wrong.