Phase 1: lock cron, reload chaud, argon2, providers, IMDb lookup, cache LRU, /health, /metrics, rate limit, UI dark, biome
This commit is contained in:
@@ -3,8 +3,8 @@
|
||||
|
||||
import { createReadStream, existsSync, readFileSync } from 'node:fs';
|
||||
import { writeFile } from 'node:fs/promises';
|
||||
import { createInterface } from 'node:readline';
|
||||
import { join } from 'node:path';
|
||||
import { createInterface } from 'node:readline';
|
||||
import { TMDBINTEGRAL_DIR } from '../config.js';
|
||||
import { entryPath } from '../lib/paths.js';
|
||||
|
||||
@@ -22,12 +22,20 @@ export async function buildMapping(type) {
|
||||
for await (const line of rl) {
|
||||
if (!line) continue;
|
||||
let obj;
|
||||
try { obj = JSON.parse(line); } catch { continue; }
|
||||
try {
|
||||
obj = JSON.parse(line);
|
||||
} catch {
|
||||
continue;
|
||||
}
|
||||
const tmdb = obj.id;
|
||||
const path = entryPath(type, tmdb);
|
||||
if (!existsSync(path)) continue;
|
||||
let detail;
|
||||
try { detail = JSON.parse(readFileSync(path, 'utf8')); } catch { continue; }
|
||||
try {
|
||||
detail = JSON.parse(readFileSync(path, 'utf8'));
|
||||
} catch {
|
||||
continue;
|
||||
}
|
||||
const imdb = detail?.external_ids?.imdb_id;
|
||||
if (imdb) {
|
||||
data1[tmdb] = imdb;
|
||||
|
||||
Reference in New Issue
Block a user