Compare commits

...
12 Commits
8 changed files with 32 additions and 10 deletions

No files matched your search

+21
View File
@@ -1,5 +1,26 @@
# Changelog
## [1.11.9](https://github.com/Masutayunikon/FanKarr/compare/v1.11.8...v1.11.9) (2026-03-20)
### Bug Fixes
* season 0 resolved is no longer skipped in the worker ([c48ec76](https://github.com/Masutayunikon/FanKarr/commit/c48ec769ba7725327e657366e882498846d0c63f))
## [1.11.8](https://github.com/Masutayunikon/FanKarr/compare/v1.11.7...v1.11.8) (2026-03-20)
### Bug Fixes
* config path /config/config to /config ([7518191](https://github.com/Masutayunikon/FanKarr/commit/75181910244621a8eca989067fd4777922914d8e))
## [1.11.7](https://github.com/Masutayunikon/FanKarr/compare/v1.11.6...v1.11.7) (2026-03-20)
### Bug Fixes
* worker path ([3df8def](https://github.com/Masutayunikon/FanKarr/commit/3df8defa5e46b09722a345c7c3a94e91aa16e4d8))
## [1.11.6](https://github.com/Masutayunikon/FanKarr/compare/v1.11.5...v1.11.6) (2026-03-20)
+1 -1
View File
@@ -6,7 +6,7 @@ import type { Request, Response, NextFunction } from 'express'
import { JWT_SECRET } from './secret.js'
import { DATA_DIR } from './config.js'
const DATA_PATH = path.join(DATA_DIR, 'config', 'auth.json')
const DATA_PATH = path.join(DATA_DIR, 'auth.json')
const SALT_ROUNDS = 10
interface AuthData {
+1 -1
View File
@@ -403,7 +403,7 @@ app.get('/api/downloads', requireAuth, async (_req, res) => {
let torrentFinal: any[] = []
try {
const tfPath = path.join(DATA_DIR, 'config', 'torrent_final.json')
const tfPath = path.join(DATA_DIR, 'torrent_final.json')
if (fs.existsSync(tfPath))
torrentFinal = JSON.parse(fs.readFileSync(tfPath, 'utf-8'))
} catch {}
+1 -1
View File
@@ -20,7 +20,7 @@ export interface LogEntry {
meta? : Record<string, any>
}
const LOGS_PATH = path.join(DATA_DIR, 'config', 'logs.jsonl')
const LOGS_PATH = path.join(DATA_DIR, 'logs.jsonl')
const MAX_LINES = 2000 // rotation auto au-delà
const IS_PROD = process.env.NODE_ENV === 'production'
+5 -4
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 } }
@@ -314,7 +314,8 @@ async function organizeTorrent(hash: string, name: string, savePath: string) {
const filePath: string[] = tf.path
// Skip les fichiers dans des dossiers bonus/musique/images
if (isInExcludedFolder(filePath)) {
const tfMeta = torrentFiles.find((tf: any) => tf.filename === filename)
if (isInExcludedFolder(filePath) && tfMeta?.season_number == null) {
log(`[organize] skip bonus: ${filename}`)
result.skipped++
continue
+1 -1
View File
@@ -11,7 +11,7 @@ import path from 'path'
import crypto from 'crypto'
import { DATA_DIR } from './config.js'
const SECRET_PATH = path.join(DATA_DIR, 'config', 'secret.key')
const SECRET_PATH = path.join(DATA_DIR, 'secret.key')
function generateSecret(): string {
return crypto.randomBytes(48).toString('hex')
+1 -1
View File
@@ -2,7 +2,7 @@ import fs from 'fs'
import path from 'path'
import { DATA_DIR } from './config.js'
const DATA_PATH = path.join(DATA_DIR, 'config', 'settings.json')
const DATA_PATH = path.join(DATA_DIR, 'settings.json')
export interface Settings {
mediaPath : string
+1 -1
View File
@@ -78,7 +78,7 @@ export function getAvailableClients(): TorrentClientDefinition[] {
// ─── Persistence (clients enregistrés) ────────────────────────────────────────
const CLIENTS_PATH = path.join(DATA_DIR, 'config', 'torrent_clients.json')
const CLIENTS_PATH = path.join(DATA_DIR, 'torrent_clients.json')
function loadClients(): SavedClient[] {
try {