Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ec971915b5 | ||
|
|
bb71b241d1 | ||
|
|
7aa01755ec | ||
|
|
8ce0ca1f24 | ||
|
|
620aac6b38 | ||
|
|
e99e413e4e | ||
|
|
fb578cf9f9 | ||
|
|
78e3055344 |
No files matched your search
@@ -1,5 +1,19 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [1.11.0](https://github.com/Masutayunikon/FanKarr/compare/v1.10.3...v1.11.0) (2026-03-13)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* fix worker for multiple series in integral (one piece fix ?) ([2c773f8](https://github.com/Masutayunikon/FanKarr/commit/2c773f83ffd76d82c77a50a9c5729f20ea22b450))
|
||||||
|
|
||||||
|
## [1.10.3](https://github.com/Masutayunikon/FanKarr/compare/v1.10.2...v1.10.3) (2026-03-13)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* worker path ([360572b](https://github.com/Masutayunikon/FanKarr/commit/360572b8be64dafbb452dfcb849a40305bf1b8cf))
|
||||||
|
|
||||||
## [1.10.2](https://github.com/Masutayunikon/FanKarr/compare/v1.10.1...v1.10.2) (2026-03-13)
|
## [1.10.2](https://github.com/Masutayunikon/FanKarr/compare/v1.10.1...v1.10.2) (2026-03-13)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -218,8 +218,35 @@ async function organizeTorrent(hash: string, name: string, savePath: string) {
|
|||||||
|
|
||||||
// ── Téléchargement NFO/images depuis GitLab ───────────────
|
// ── Téléchargement NFO/images depuis GitLab ───────────────
|
||||||
if (nfoSupport) {
|
if (nfoSupport) {
|
||||||
const serieDestRoot = path.join(mediaPath, serieTitle)
|
// Collecter tous les titres de séries distincts depuis resolved_episodes
|
||||||
await downloadGitlabFolder(serieTitle, serieDestRoot)
|
// (un pack_integrale peut mélanger plusieurs séries, ex: One Piece Yabai + Kaï)
|
||||||
|
const serieTitlesMap = new Map<number, string>()
|
||||||
|
|
||||||
|
// Titre principal du torrent
|
||||||
|
serieTitlesMap.set(torrent.serie_id ?? 0, serieTitle)
|
||||||
|
|
||||||
|
// Titres alternatifs depuis resolved_episodes
|
||||||
|
// resolved_episodes n'a pas toujours serie_title → on cherche dans torrent_final.json
|
||||||
|
const allTorrents: any[] = (() => {
|
||||||
|
try { return JSON.parse(fs.readFileSync(TORRENTS_PATH, 'utf-8')) } catch { return [] }
|
||||||
|
})()
|
||||||
|
const serieIdToTitle = new Map<number, string>()
|
||||||
|
for (const t of allTorrents) {
|
||||||
|
if (t.serie_id && t.serie_title) serieIdToTitle.set(t.serie_id, t.serie_title)
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const ep of torrent.resolved_episodes ?? []) {
|
||||||
|
if (ep.serie_id && !serieTitlesMap.has(ep.serie_id)) {
|
||||||
|
const title = ep.serie_title ?? serieIdToTitle.get(ep.serie_id)
|
||||||
|
if (title) serieTitlesMap.set(ep.serie_id, title)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Télécharger NFO pour chaque série distincte
|
||||||
|
for (const title of serieTitlesMap.values()) {
|
||||||
|
const serieDestRoot = path.join(mediaPath, title)
|
||||||
|
await downloadGitlabFolder(title, serieDestRoot)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ── Cas fichier unique ────────────────────────────────────
|
// ── Cas fichier unique ────────────────────────────────────
|
||||||
|
|||||||
+4
-3
@@ -17,9 +17,10 @@ let workerRunning = false
|
|||||||
// En binaire Bun compilé : le worker est à côté de l'exécutable
|
// En binaire Bun compilé : le worker est à côté de l'exécutable
|
||||||
// En Docker/dev : à côté du fichier courant
|
// En Docker/dev : à côté du fichier courant
|
||||||
function resolveWorkerPath(): string {
|
function resolveWorkerPath(): string {
|
||||||
const _isBunBinary = typeof (globalThis as any).Bun !== 'undefined'
|
// Si Bun est présent → le worker est toujours à côté de l'exécutable
|
||||||
&& path.dirname((process as any).execPath) !== process.cwd()
|
// (que ce soit un binaire compilé ou `bun run` en dev)
|
||||||
if (_isBunBinary) {
|
// En Node/tsx → on utilise import.meta.url
|
||||||
|
if (typeof (globalThis as any).Bun !== 'undefined') {
|
||||||
return path.join(path.dirname((process as any).execPath), 'organize-worker.js')
|
return path.join(path.dirname((process as any).execPath), 'organize-worker.js')
|
||||||
}
|
}
|
||||||
return path.join(path.dirname(new URL(import.meta.url).pathname), 'organize-worker.js')
|
return path.join(path.dirname(new URL(import.meta.url).pathname), 'organize-worker.js')
|
||||||
|
|||||||
Reference in new issue
Block a user