fix: filter video definitions 2

This commit is contained in:
TrèsAbhi committed 2024-05-03 10:38:55 -05:00
1 parent b151c7483a
commit be8d565545
2 files changed
+3 -2

No files matched your search

-1
View File
@@ -128,7 +128,6 @@ export async function videos(production: boolean) {
}
const content = Object.entries(videos)
.filter(([_, { videos }]) => videos.length > 0)
.map(
([id, { videos, lastUpdated }]) =>
`${id},${lastUpdated},${videos.join(',')}`,
+3 -1
View File
@@ -13,7 +13,9 @@ export const videoDefinitions = fetch(asset('definitions/videos.csv'))
text
.split('\n')
.map((line) => {
const [idString, lastUpdatedString, ...videos] = line.split(',');
const [idString, lastUpdatedString, ...videos] = line
.split(',')
.filter(Boolean);
const id = Number(idString);
const lastUpdated = Number(lastUpdatedString);
return { id, videos, lastUpdated };