mirror of
https://git.luna-app.eu/50n50/sources
synced 2025-12-22 13:46:29 +01:00
Update torrentio/torrentio.js
This commit is contained in:
parent
5261ebb2c5
commit
e5b8e16feb
1 changed files with 4 additions and 3 deletions
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
// Settings start
|
// Settings start
|
||||||
const preferedQualityOption = "Auto"; // ["Auto", "2160p", "1080p", "720p", "480p"]
|
const preferedQualityOption = "Auto"; // ["Auto", "2160p", "1080p", "720p", "480p"]
|
||||||
const debridService = "realdebrid"; // ["realdebrid", "alldebrid", "premiumize", "torbox", "debridlink"]
|
const debridService = "realdebrid"; // ["realdebrid", "alldebrid", "premiumize", "torbox", "debridlink"]
|
||||||
|
|
@ -95,11 +94,13 @@ async function extractEpisodes(ID) {
|
||||||
|
|
||||||
const videos = data.meta.videos || [];
|
const videos = data.meta.videos || [];
|
||||||
|
|
||||||
|
const shouldAdjust = videos.length > 0 && videos[0].season === 0;
|
||||||
|
|
||||||
let currentSeason = 0;
|
let currentSeason = 0;
|
||||||
let episodeCounter = 0;
|
let episodeCounter = 0;
|
||||||
|
|
||||||
for (const video of videos) {
|
for (const video of videos) {
|
||||||
const adjustedSeason = video.season + 1;
|
const adjustedSeason = shouldAdjust ? video.season + 1 : video.season;
|
||||||
if (adjustedSeason !== currentSeason) {
|
if (adjustedSeason !== currentSeason) {
|
||||||
currentSeason = adjustedSeason;
|
currentSeason = adjustedSeason;
|
||||||
episodeCounter = 0;
|
episodeCounter = 0;
|
||||||
|
|
@ -108,7 +109,7 @@ async function extractEpisodes(ID) {
|
||||||
episodeCounter++;
|
episodeCounter++;
|
||||||
|
|
||||||
let adjustedId = video.id || "";
|
let adjustedId = video.id || "";
|
||||||
if (adjustedId) {
|
if (adjustedId && shouldAdjust) {
|
||||||
const idParts = adjustedId.split(':');
|
const idParts = adjustedId.split(':');
|
||||||
if (idParts.length === 3) {
|
if (idParts.length === 3) {
|
||||||
idParts[1] = String(adjustedSeason);
|
idParts[1] = String(adjustedSeason);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue