forked from 50n50/sources
Update comet/comet.js
This commit is contained in:
+13
-4
@@ -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 maxResultsPerResolution = 0;
|
const maxResultsPerResolution = 0;
|
||||||
@@ -110,15 +109,25 @@ async function extractEpisodes(ID) {
|
|||||||
let episodeCounter = 0;
|
let episodeCounter = 0;
|
||||||
|
|
||||||
for (const video of videos) {
|
for (const video of videos) {
|
||||||
if (video.season !== currentSeason) {
|
const adjustedSeason = video.season + 1;
|
||||||
currentSeason = video.season;
|
if (adjustedSeason !== currentSeason) {
|
||||||
|
currentSeason = adjustedSeason;
|
||||||
episodeCounter = 0;
|
episodeCounter = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
episodeCounter++;
|
episodeCounter++;
|
||||||
|
|
||||||
|
let adjustedId = video.id || "";
|
||||||
|
if (adjustedId) {
|
||||||
|
const idParts = adjustedId.split(':');
|
||||||
|
if (idParts.length === 3) {
|
||||||
|
idParts[1] = String(adjustedSeason);
|
||||||
|
adjustedId = idParts.join(':');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
results.push({
|
results.push({
|
||||||
href: "TV: " + (video.id || ""),
|
href: "TV: " + adjustedId,
|
||||||
number: episodeCounter
|
number: episodeCounter
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user