Phase 1: lock cron, reload chaud, argon2, providers, IMDb lookup, cache LRU, /health, /metrics, rate limit, UI dark, biome
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { writeFile } from 'node:fs/promises';
|
||||
import { join } from 'node:path';
|
||||
import { TMDBINTEGRAL_DIR, NB_SEARCH_PARTS } from '../config.js';
|
||||
import { NB_SEARCH_PARTS, TMDBINTEGRAL_DIR } from '../config.js';
|
||||
|
||||
const TMDB = 0;
|
||||
const FILTEREDTITLE = 4;
|
||||
@@ -32,9 +32,24 @@ export async function buildAmbiguity(type, nbParts = NB_SEARCH_PARTS) {
|
||||
const fr = db[FILTEREDTITLE];
|
||||
const en = db[FILTEREDENGLISHTITLE];
|
||||
const vo = db[FILTEREDORIGINALTITLE];
|
||||
if (fr) { tmdbs.push(db[TMDB]); filteredTitles.push(fr); years.push(db[YEAR][0]); languages.push('FR'); }
|
||||
if (en) { tmdbs.push(db[TMDB]); filteredTitles.push(en); years.push(db[YEAR][0]); languages.push('EN'); }
|
||||
if (vo) { tmdbs.push(db[TMDB]); filteredTitles.push(vo); years.push(db[YEAR][0]); languages.push('VO'); }
|
||||
if (fr) {
|
||||
tmdbs.push(db[TMDB]);
|
||||
filteredTitles.push(fr);
|
||||
years.push(db[YEAR][0]);
|
||||
languages.push('FR');
|
||||
}
|
||||
if (en) {
|
||||
tmdbs.push(db[TMDB]);
|
||||
filteredTitles.push(en);
|
||||
years.push(db[YEAR][0]);
|
||||
languages.push('EN');
|
||||
}
|
||||
if (vo) {
|
||||
tmdbs.push(db[TMDB]);
|
||||
filteredTitles.push(vo);
|
||||
years.push(db[YEAR][0]);
|
||||
languages.push('VO');
|
||||
}
|
||||
}
|
||||
|
||||
// PHP: array_multisort(filteredtitles, years, tmdbs, languages)
|
||||
@@ -87,7 +102,7 @@ export async function buildAmbiguity(type, nbParts = NB_SEARCH_PARTS) {
|
||||
}
|
||||
flush();
|
||||
|
||||
await writeFile(out, lines.length ? lines.join('\n') + '\n' : '');
|
||||
await writeFile(out, lines.length ? `${lines.join('\n')}\n` : '');
|
||||
}
|
||||
|
||||
if (import.meta.url === `file://${process.argv[1]}`) {
|
||||
|
||||
Reference in New Issue
Block a user