Update comet/comet.js
This commit is contained in:
+4
-2
@@ -105,11 +105,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;
|
||||
@@ -118,7 +120,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);
|
||||
|
||||
Reference in New Issue
Block a user