forgot a file
This commit is contained in:
parent
8eeee8cbff
commit
865e4ad42c
|
|
@ -190,7 +190,7 @@ app.get('/channel/:id', async ({ params: { id }, set }) => {
|
||||||
const processedVideos: processedVideo[] = videos.map((video: any) => ({ // it would be impossible to set types for youtube output... they change it every day.
|
const processedVideos: processedVideo[] = videos.map((video: any) => ({ // it would be impossible to set types for youtube output... they change it every day.
|
||||||
id: video.videoId,
|
id: video.videoId,
|
||||||
title: video.title,
|
title: video.title,
|
||||||
thumbnail: video.thumbnails?.[0]?.url || video.videoThumbnails?.[0]?.url || '',
|
thumbnail: video.videoThumbnails?.at(-1)?.url || '',
|
||||||
published: video.published
|
published: video.published
|
||||||
? new Date(video.published).toISOString().slice(0, 10)
|
? new Date(video.published).toISOString().slice(0, 10)
|
||||||
: video.publishedText || ''
|
: video.publishedText || ''
|
||||||
|
|
@ -208,12 +208,12 @@ app.get('/channel/:id', async ({ params: { id }, set }) => {
|
||||||
processedVideos.sort((a: any, b: any) => new Date(b.published).getTime() - new Date(a.published).getTime());
|
processedVideos.sort((a: any, b: any) => new Date(b.published).getTime() - new Date(a.published).getTime());
|
||||||
|
|
||||||
const html = await m(eta.render('./channel', {
|
const html = await m(eta.render('./channel', {
|
||||||
name: channel.metadata.title,
|
name: channel.author,
|
||||||
avatar: channel.metadata.avatar[0].url,
|
avatar: channel.authorThumbnails[0].url,
|
||||||
verified: channel.header.author?.is_verified,
|
verified: channel.authorVerified,
|
||||||
videos: processedVideos,
|
videos: processedVideos,
|
||||||
title: `${channel.metadata.title} | PreserveTube`,
|
title: `${channel.author} | PreserveTube`,
|
||||||
keywords: `${channel.metadata.title} archive, ${channel.metadata.title} channel archive, ${channel.metadata.title} deleted video, ${channel.metadata.title} video deleted`
|
keywords: `${channel.author} archive, ${channel.author} channel archive, ${channel.author} deleted video, ${channel.author} video deleted`
|
||||||
}))
|
}))
|
||||||
await redis.set(`channel:${id}:html`, html, 'EX', 3600)
|
await redis.set(`channel:${id}:html`, html, 'EX', 3600)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue