Creation automatique des dossiers tmdbintegral/* au premier run

This commit is contained in:
unfr
2026-04-23 10:56:45 +02:00
parent 7170953606
commit f9745a2390
3 changed files with 6 additions and 1 deletions

View File

@@ -68,6 +68,8 @@ function removeOrphans(type, ids) {
} }
export async function syncType(type) { export async function syncType(type) {
const baseDir = type === 'movie' ? JUSTWATCH_MOVIE_DIR : JUSTWATCH_TV_DIR;
await mkdir(baseDir, { recursive: true });
const ids = await readMasterIds(type); const ids = await readMasterIds(type);
const limiter = new Limiter(DOWNLOAD_CONCURRENCY); const limiter = new Limiter(DOWNLOAD_CONCURRENCY);
const tasks = []; const tasks = [];

View File

@@ -1,5 +1,5 @@
import { createWriteStream } from 'node:fs'; import { createWriteStream } from 'node:fs';
import { rename } from 'node:fs/promises'; import { rename, mkdir } from 'node:fs/promises';
import { pipeline } from 'node:stream/promises'; import { pipeline } from 'node:stream/promises';
import { createGunzip } from 'node:zlib'; import { createGunzip } from 'node:zlib';
import { Readable } from 'node:stream'; import { Readable } from 'node:stream';
@@ -44,6 +44,7 @@ async function downloadExport(prefix, outName) {
} }
export async function syncExports() { export async function syncExports() {
await mkdir(TMDBINTEGRAL_DIR, { recursive: true });
await downloadExport('movie_ids', 'movie.json'); await downloadExport('movie_ids', 'movie.json');
await downloadExport('tv_series_ids', 'tv.json'); await downloadExport('tv_series_ids', 'tv.json');
} }

View File

@@ -139,6 +139,8 @@ function removeOrphans(type, sortedIds) {
} }
export async function syncType(type) { export async function syncType(type) {
const baseDir = type === 'movie' ? MOVIE_DIR : TV_DIR;
await mkdir(baseDir, { recursive: true });
const updates = await findChanges(type); const updates = await findChanges(type);
const ids = await readMasterIds(type); const ids = await readMasterIds(type);