Test & fix entry video join

This commit is contained in:
2025-03-04 10:59:51 +01:00
parent 477fb24036
commit 70d0d480f6
13 changed files with 77 additions and 35 deletions

View File

@@ -121,6 +121,7 @@ export const insertEntries = async (
return {
videoId: seed.video,
entryPk: retEntries[i].pk,
entrySlug: retEntries[i].slug,
needRendering: false,
};
}
@@ -128,6 +129,7 @@ export const insertEntries = async (
return seed.videos.map((x, j) => ({
videoId: x,
entryPk: retEntries[i].pk,
entrySlug: retEntries[i].slug,
// The first video should not have a rendering.
needRendering: j && seed.videos!.length > 1,
}));
@@ -142,9 +144,9 @@ export const insertEntries = async (
db
.select({
entryPk: sql<number>`vids.entryPk::integer`.as("entry"),
videoPk: sql`${videos.pk}`.as("video"),
videoPk: videos.pk,
slug: computeVideoSlug(
sql`${show.slug}::text`,
sql`vids.entrySlug::text`,
sql`vids.needRendering::boolean`,
),
})