Extract shared constants into lib/constants.ts

- Add `lib/constants.ts` exporting `DATA_DIR`, `DATABASE_URL`, `CACHE_DIR`,
  `BACKUP_DIR`, `AVATAR_DIR`, `TMDB_API_BASE_URL`, and `TMDB_IMAGE_BASE_URL`
- Replace inline `process.env` derivations in `db/client`, `backup`,
  `image-cache`, `system-health`, `tmdb/client`, `actions/settings`,
  and `api/avatars` with imports from the new module
This commit is contained in:
2026-03-08 11:06:29 -04:00
parent 84c4356a9f
commit 17fe19e85b
8 changed files with 35 additions and 38 deletions
+1 -3
View File
@@ -1,8 +1,6 @@
import path from "node:path";
import { type NextRequest, NextResponse } from "next/server";
const DATA_DIR = process.env.DATA_DIR || "./data";
const AVATAR_DIR = path.join(DATA_DIR, "avatars");
import { AVATAR_DIR } from "@/lib/constants";
const IMMUTABLE_CACHE = "public, max-age=31536000, immutable";