mirror of
https://git.luna-app.eu/50n50/sources
synced 2025-12-21 21:26:19 +01:00
Update comet/comet.js
This commit is contained in:
parent
c85a891c64
commit
043119e046
1 changed files with 13 additions and 4 deletions
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
// Settings start
|
||||
const preferedQualityOption = "Auto"; // ["Auto", "2160p", "1080p", "720p", "480p"]
|
||||
const maxResultsPerResolution = 0;
|
||||
|
|
@ -110,15 +109,25 @@ async function extractEpisodes(ID) {
|
|||
let episodeCounter = 0;
|
||||
|
||||
for (const video of videos) {
|
||||
if (video.season !== currentSeason) {
|
||||
currentSeason = video.season;
|
||||
const adjustedSeason = video.season + 1;
|
||||
if (adjustedSeason !== currentSeason) {
|
||||
currentSeason = adjustedSeason;
|
||||
episodeCounter = 0;
|
||||
}
|
||||
|
||||
episodeCounter++;
|
||||
|
||||
let adjustedId = video.id || "";
|
||||
if (adjustedId) {
|
||||
const idParts = adjustedId.split(':');
|
||||
if (idParts.length === 3) {
|
||||
idParts[1] = String(adjustedSeason);
|
||||
adjustedId = idParts.join(':');
|
||||
}
|
||||
}
|
||||
|
||||
results.push({
|
||||
href: "TV: " + (video.id || ""),
|
||||
href: "TV: " + adjustedId,
|
||||
number: episodeCounter
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue