mirror of
https://github.com/zoriya/Kyoo.git
synced 2026-05-22 23:22:27 -04:00
Test & fix entry video join
This commit is contained in:
@@ -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`,
|
||||
),
|
||||
})
|
||||
|
||||
@@ -7,8 +7,11 @@ import { processOptImage } from "../images";
|
||||
type StudioI = typeof studios.$inferInsert;
|
||||
type StudioTransI = typeof studioTranslations.$inferInsert;
|
||||
|
||||
export const insertStudios = async (seed: SeedStudio[], showPk: number) => {
|
||||
if (!seed.length) return [];
|
||||
export const insertStudios = async (
|
||||
seed: SeedStudio[] | undefined,
|
||||
showPk: number,
|
||||
) => {
|
||||
if (!seed?.length) return [];
|
||||
|
||||
return await db.transaction(async (tx) => {
|
||||
const vals: StudioI[] = seed.map((x) => {
|
||||
|
||||
Reference in New Issue
Block a user