fix: path
This commit is contained in:
1 parent
418d09b07f
commit
77d918fbe0
8 files changed
+17
-17
No files matched your search
@@ -15,10 +15,10 @@ import fs from 'fs'
|
||||
import fsp from 'fs/promises'
|
||||
import path from 'path'
|
||||
import { parentPort } from 'worker_threads'
|
||||
import { BASE_DIR, _isBunBinary } from './config.js'
|
||||
import { DATA_DIR } from './config.js'
|
||||
|
||||
const TORRENTS_PATH = path.join(BASE_DIR, 'config', 'torrent_final.json')
|
||||
const ORGANIZED_PATH = path.join(BASE_DIR, 'config', 'organized.json')
|
||||
const TORRENTS_PATH = path.join(DATA_DIR, 'config', 'torrent_final.json')
|
||||
const ORGANIZED_PATH = path.join(DATA_DIR, 'config', '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(BASE_DIR, 'config', 'settings.json')
|
||||
const p = path.join(DATA_DIR, 'config', '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 } }
|
||||
|
||||
Reference in new issue
Block a user