2026-04-23 08:37:48 +02:00
|
|
|
import { join } from 'node:path';
|
Phase 1: lock cron, reload chaud, argon2, providers, IMDb lookup, cache LRU, /health, /metrics, rate limit, UI dark, biome
2026-04-24 07:35:10 +02:00
|
|
|
import { JUSTWATCH_MOVIE_DIR, JUSTWATCH_TV_DIR, MOVIE_DIR, TV_DIR } from '../config.js';
|
2026-04-23 08:37:48 +02:00
|
|
|
|
|
|
|
|
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));
|
|
|
|
|
}
|