Use an images table to prevent dup downloads

This commit is contained in:
Zoe Roux
2025-12-21 18:12:44 +01:00
parent 11060df0d0
commit 1a1ccc9d4c
8 changed files with 2156 additions and 70 deletions
+5 -5
View File
@@ -79,15 +79,15 @@ export function sqlarr(array: unknown[]): string {
return str.replaceAll("\\", "\\\\").replaceAll('"', '\\"');
}
// we treat arrays as object to have them as jsonb arrays instead of pg arrays.
// nested arrays doesn't work well with unnest anyways.
return `{${array
.map((item) =>
item === "null" || item === null || item === undefined
? "null"
: Array.isArray(item)
? sqlarr(item)
: typeof item === "object"
? `"${escapeStr(JSON.stringify(item))}"`
: `"${escapeStr(item.toString())}"`,
: typeof item === "object"
? `"${escapeStr(JSON.stringify(item))}"`
: `"${escapeStr(item.toString())}"`,
)
.join(", ")}}`;
}