Skip to content

Commit

Permalink
add modern description
Browse files Browse the repository at this point in the history
  • Loading branch information
dtinth committed Mar 2, 2025
1 parent 0234abc commit f686abc
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
9 changes: 9 additions & 0 deletions src/Event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export class Event {
public name: string,
private options: EventOptions = {},
) {}
public descriptionMode: 'modern' | 'classic' = 'modern'
static async findAll() {
return events
}
Expand Down Expand Up @@ -173,3 +174,11 @@ const events = [
}),
new Event('market', 'Creative Coding Meetup #3'),
]

// To prevent YouTube API running out of quota,
// we will gradually update the description mode
// from 'classic' to 'modern' for all events.
for (const event of events) {
if (event.id === 'bac') break
event.descriptionMode = 'classic'
}
13 changes: 11 additions & 2 deletions src/VideoMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,17 @@ export async function getVideoDescription(
'For reuse of this video under a more permissive license please get in touch with us. The speakers retain the copyright for their performances.',
'mail@creatorsgarten.org',
'',
'To edit the video metadata (title, description, timestamps, thumbnail, etc.), please visit:',
`https://grtn.org/e/${video.event}/v/${video.slug}/edit`,
...(event.descriptionMode === 'classic'
? [
'To edit the video metadata (title, description, timestamps, thumbnail, etc.), please visit:',
`https://grtn.org/e/${video.event}/v/${video.slug}/edit`,
]
: [
video.englishSubtitlePath || video.thaiSubtitlePath
? 'Want to read the full transcript or spotted an error? Visit our site where you can report inaccuracies in subtitles or help improve video metadata.'
: 'Want to learn more about this talk or spotted an error in the metadata? Visit our site where you can help improve video information and details.',
`https://grtn.org/v/${video.event}/${video.slug}`,
]),
...(video.data.tags
? ['', video.data.tags.map((tag) => `#${tag}`).join(' ')]
: []),
Expand Down

0 comments on commit f686abc

Please sign in to comment.