Fix tests

This commit is contained in:
Zoe Roux
2025-03-08 22:53:58 +01:00
parent fd57f506c1
commit 3f77a1bda5
10 changed files with 53 additions and 22 deletions
+6
View File
@@ -8,6 +8,12 @@ export const bubbleVideo: Video = {
rendering: "459429fa062adeebedcc2bb04b9965de0262bfa453369783132d261be79021bd",
part: null,
version: 1,
guess: {
kind: "movie",
title: "bubble",
year: [2022],
from: "guessit",
},
createdAt: "2024-11-23T15:01:24.968Z",
updatedAt: "2024-11-23T15:01:24.968Z",
};
+6
View File
@@ -8,6 +8,12 @@ export const dune1984Video: Video = {
rendering: "ea3a0f8f2f2c5b61a07f61e4e8d9f8e01b2b92bcbb6f5ed1151e1f61619c2c0f",
part: null,
version: 1,
guess: {
kind: "movie",
title: "dune",
year: [1984],
from: "guessit",
},
createdAt: "2024-12-02T11:45:12.968Z",
updatedAt: "2024-12-02T11:45:12.968Z",
};
+6
View File
@@ -8,6 +8,12 @@ export const duneVideo: Video = {
rendering: "f1953a4fb58247efb6c15b76468b6a9d13b4155b02094863b1a4f0c3fbb6db58",
part: null,
version: 1,
guess: {
kind: "movie",
title: "dune",
year: [2021],
from: "guessit",
},
createdAt: "2024-12-02T10:10:24.968Z",
updatedAt: "2024-12-02T10:10:24.968Z",
};
+2 -1
View File
@@ -78,9 +78,10 @@ export const sortToSql = <
T extends string[],
Remap extends Partial<Record<T[number], string>>,
>(
sort: Sort<T, Remap>,
sort: Sort<T, Remap> | undefined,
table: Table<Sort<T, Remap>["sort"][number]["key"] | "pk">,
) => {
if (!sort) return [];
if (sort.random) {
return [sql`md5(${sort.random.seed} || ${table.pk})`];
}