Portage complet PHP/Bash vers Node.js (Fastify + worker_threads)

This commit is contained in:
unfr
2026-04-23 08:37:48 +02:00
parent 2f7c990376
commit 3563de52e9
28 changed files with 3348 additions and 0 deletions

26
lib/paths.js Normal file
View File

@@ -0,0 +1,26 @@
import { join } from 'node:path';
import { MOVIE_DIR, TV_DIR, JUSTWATCH_MOVIE_DIR, JUSTWATCH_TV_DIR } from '../config.js';
export function bucket(id) {
return String(Math.floor(id / 1000));
}
export function entryPath(type, id) {
const base = type === 'movie' ? MOVIE_DIR : TV_DIR;
return join(base, bucket(id), `${id}.json`);
}
export function entryDir(type, id) {
const base = type === 'movie' ? MOVIE_DIR : TV_DIR;
return join(base, bucket(id));
}
export function justwatchPath(type, id) {
const base = type === 'movie' ? JUSTWATCH_MOVIE_DIR : JUSTWATCH_TV_DIR;
return join(base, bucket(id), `${id}.json`);
}
export function justwatchDir(type, id) {
const base = type === 'movie' ? JUSTWATCH_MOVIE_DIR : JUSTWATCH_TV_DIR;
return join(base, bucket(id));
}