fix: worker path

This commit is contained in:
MasutaYunikon committed 2026-03-20 20:17:46 +01:00
1 parent 5a71bdca3c
commit b0e81166e1
1 file changed
+3 -3
+3 -3
View File
@@ -17,8 +17,8 @@ import path from 'path'
import { parentPort } from 'worker_threads'
import { DATA_DIR } from './config.js'
const TORRENTS_PATH = path.join(DATA_DIR, 'config', 'torrent_final.json')
const ORGANIZED_PATH = path.join(DATA_DIR, 'config', 'organized.json')
const TORRENTS_PATH = path.join(DATA_DIR, 'torrent_final.json')
const ORGANIZED_PATH = path.join(DATA_DIR, 'organized.json')
// ─── Utils log ────────────────────────────────────────────────
// Le worker tourne dans un thread séparé — il passe les logs au thread principal
@@ -33,7 +33,7 @@ function debug(msg: string) { parentPort?.postMessage({ type: 'log', level: 'deb
function readSettings(): { mediaPath: string; completePath: string; organizeMode: string; nfoSupport: boolean } {
try {
const p = path.join(DATA_DIR, 'config', 'settings.json')
const p = path.join(DATA_DIR, 'settings.json')
if (!fs.existsSync(p)) return { mediaPath: '', completePath: '', organizeMode: 'hardlink', nfoSupport: false }
return JSON.parse(fs.readFileSync(p, 'utf-8'))
} catch { return { mediaPath: '', completePath: '', organizeMode: 'hardlink', nfoSupport: false } }