fix: worker path
This commit is contained in:
1 parent
5a71bdca3c
commit
b0e81166e1
1 file changed
+3
-3
@@ -17,8 +17,8 @@ import path from 'path'
|
|||||||
import { parentPort } from 'worker_threads'
|
import { parentPort } from 'worker_threads'
|
||||||
import { DATA_DIR } from './config.js'
|
import { DATA_DIR } from './config.js'
|
||||||
|
|
||||||
const TORRENTS_PATH = path.join(DATA_DIR, 'config', 'torrent_final.json')
|
const TORRENTS_PATH = path.join(DATA_DIR, 'torrent_final.json')
|
||||||
const ORGANIZED_PATH = path.join(DATA_DIR, 'config', 'organized.json')
|
const ORGANIZED_PATH = path.join(DATA_DIR, 'organized.json')
|
||||||
|
|
||||||
// ─── Utils log ────────────────────────────────────────────────
|
// ─── Utils log ────────────────────────────────────────────────
|
||||||
// Le worker tourne dans un thread séparé — il passe les logs au thread principal
|
// 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 } {
|
function readSettings(): { mediaPath: string; completePath: string; organizeMode: string; nfoSupport: boolean } {
|
||||||
try {
|
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 }
|
if (!fs.existsSync(p)) return { mediaPath: '', completePath: '', organizeMode: 'hardlink', nfoSupport: false }
|
||||||
return JSON.parse(fs.readFileSync(p, 'utf-8'))
|
return JSON.parse(fs.readFileSync(p, 'utf-8'))
|
||||||
} catch { return { mediaPath: '', completePath: '', organizeMode: 'hardlink', nfoSupport: false } }
|
} catch { return { mediaPath: '', completePath: '', organizeMode: 'hardlink', nfoSupport: false } }
|
||||||
|
|||||||
Reference in new issue
Block a user