This commit is contained in:
Zoe Roux 2025-01-12 16:22:51 +01:00
parent 9a54266967
commit b9da57fd88
No known key found for this signature in database

View File

@ -95,14 +95,12 @@ export const movies = new Elysia({ prefix: "/movies", tags: ["movies"] })
return error(404, {
status: 404,
message: "Movie not found",
details: undefined,
});
}
if (!ret.translation) {
return error(422, {
status: 422,
message: "Accept-Language header could not be satisfied.",
details: undefined,
});
}
set.headers["content-language"] = ret.translation.language;
@ -211,7 +209,7 @@ export const movies = new Elysia({ prefix: "/movies", tags: ["movies"] })
.innerJoin(transQ, eq(shows.pk, transQ.pk))
.where(and(filter, keysetPaginate({ table: shows, after, sort })))
.orderBy(
...(sort.random !== undefined
...(sort.random
? [sql`md5(${sort.random.seed} || ${shows.pk})`]
: []),
...sort.sort.map((x) =>