Fix color extraction and image cache setup in development

Move `ensureImageDirs` outside the production-only block so the local
image cache directories are created in dev mode too. Update
`extractAndStoreColors` to download the poster if it isn't cached yet
instead of falling back to a direct TMDB CDN URL, keeping color
extraction consistent with the server-side image routing approach. Add
`/data` to `.gitignore` to avoid committing the local cache directory.
This commit is contained in:
2026-03-02 13:49:57 -05:00
parent 8eb1007612
commit 2f0fe02d26
6 changed files with 22 additions and 18 deletions
+1 -1
View File
@@ -9,7 +9,7 @@ const globalForDb = globalThis as unknown as {
if (!globalForDb._client) {
globalForDb._client = createClient({
url: process.env.DATABASE_URL ?? "file:sqlite.db",
url: process.env.DATABASE_URL ?? "file:./data/sqlite.db",
});
globalForDb._client.execute("PRAGMA journal_mode = WAL");
globalForDb._client.execute("PRAGMA foreign_keys = ON");