Add thumbnails to video list

This commit is contained in:
Sam Carlton 2020-12-10 23:41:01 -06:00
parent 31ec38f5ed
commit a2e8ad9f43

View file

@ -24,7 +24,8 @@ export default async function ( applist ) {
const response = await axios.get(process.env.VIDEO_SOURCE) const response = await axios.get(process.env.VIDEO_SOURCE)
// Extract commit from response data // Extract commit from response data
const fetchedVideos = response.data const fetchedVideos = response.data
// console.log('commits', commits)
// console.log('fetchedVideos', fetchedVideos)
const videos = [] const videos = []
@ -43,14 +44,14 @@ export default async function ( applist ) {
} }
} }
// console.log('fetchedVideos[videoId].rawData.snippet.publishedAt', fetchedVideos[videoId].rawData.snippet.publishedAt) // console.log('fetchedVideos[videoId].rawData.snippet', fetchedVideos[videoId].rawData.snippet)
const lastUpdated = { const lastUpdated = {
raw: fetchedVideos[videoId].rawData.snippet.publishedAt, raw: fetchedVideos[videoId].rawData.snippet.publishedAt,
timestamp: parseGithubDate(fetchedVideos[videoId].rawData.snippet.publishedAt).timestamp, timestamp: parseGithubDate(fetchedVideos[videoId].rawData.snippet.publishedAt).timestamp,
} }
// console.log('lastUpdated', lastUpdated) // console.log('fetchedVideos[videoId].thumbnails', fetchedVideos[videoId].thumbnails)
videos.push({ videos.push({
name: fetchedVideos[videoId].title, name: fetchedVideos[videoId].title,
@ -59,6 +60,7 @@ export default async function ( applist ) {
apps, apps,
slug, slug,
timestamps: fetchedVideos[videoId].timestamps, timestamps: fetchedVideos[videoId].timestamps,
thumbnails: fetchedVideos[videoId].rawData.snippet.thumbnails,
endpoint: `/tv/${slug}` endpoint: `/tv/${slug}`
}) })
} }