From e5b8e16feb85c3fa48aac5dc68758d7b62963aa2 Mon Sep 17 00:00:00 2001 From: aka paul <50n50@noreply.localhost> Date: Sun, 2 Nov 2025 21:05:49 +0000 Subject: [PATCH] Update torrentio/torrentio.js --- torrentio/torrentio.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/torrentio/torrentio.js b/torrentio/torrentio.js index adaa620..eea9d8f 100644 --- a/torrentio/torrentio.js +++ b/torrentio/torrentio.js @@ -1,4 +1,3 @@ - // Settings start const preferedQualityOption = "Auto"; // ["Auto", "2160p", "1080p", "720p", "480p"] const debridService = "realdebrid"; // ["realdebrid", "alldebrid", "premiumize", "torbox", "debridlink"] @@ -95,11 +94,13 @@ async function extractEpisodes(ID) { const videos = data.meta.videos || []; + const shouldAdjust = videos.length > 0 && videos[0].season === 0; + let currentSeason = 0; let episodeCounter = 0; for (const video of videos) { - const adjustedSeason = video.season + 1; + const adjustedSeason = shouldAdjust ? video.season + 1 : video.season; if (adjustedSeason !== currentSeason) { currentSeason = adjustedSeason; episodeCounter = 0; @@ -108,7 +109,7 @@ async function extractEpisodes(ID) { episodeCounter++; let adjustedId = video.id || ""; - if (adjustedId) { + if (adjustedId && shouldAdjust) { const idParts = adjustedId.split(':'); if (idParts.length === 3) { idParts[1] = String(adjustedSeason);