fix: rename if the torrent name is not the same as the api

This commit is contained in:
MasutaYunikon committed 2026-03-11 19:47:53 +01:00
1 parent 15b4a99c86
commit 510e1f7b5a
1 file changed
+3 -1
+3 -1
View File
@@ -196,7 +196,9 @@ async function organizeTorrent(hash: string, name: string, savePath: string) {
const seasonNum = filenameSeasonMap.get(filename) ?? 1
const destDir = path.join(mediaPath, serieTitle, seasonFolder(seasonNum))
const dest = path.join(destDir, filename)
const resolvedEp = torrent.resolved_episodes?.find((e: any) => e.filename === filename)
const destName = resolvedEp?.original_filename ?? filename
const dest = path.join(destDir, destName)
if (fs.existsSync(dest)) {
markOrganized(hash, filename)