mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-26 06:42:50 +02:00
Fix?
This commit is contained in:
@@ -98,14 +98,13 @@ module.exports = class JeopardyScrape {
|
|||||||
const cluesBefore = this.clues.length;
|
const cluesBefore = this.clues.length;
|
||||||
const latestSeason = this.seasons[this.seasons.length - 1];
|
const latestSeason = this.seasons[this.seasons.length - 1];
|
||||||
const seasons = await this.fetchSeasons();
|
const seasons = await this.fetchSeasons();
|
||||||
const newSeasons = seasons.filter(season => !this.seasons.includes(season));
|
for (const season of seasons) {
|
||||||
this.seasons.push(...newSeasons);
|
if (this.seasons.includes(season) && latestSeason !== season) continue;
|
||||||
if (latestSeason) newSeasons.push(latestSeason);
|
if (!latestSeason === season) this.seasons.push(season);
|
||||||
for (const season of newSeasons) {
|
|
||||||
const games = await this.fetchSeason(season);
|
const games = await this.fetchSeason(season);
|
||||||
const newGames = games.filter(game => !this.gameIDs.includes(game));
|
for (const gameID of games) {
|
||||||
this.gameIDs.push(...newGames);
|
if (this.gameIDs.includes(gameID)) continue;
|
||||||
for (const gameID of newGames) {
|
this.gameIDs.push(gameID);
|
||||||
const clues = await this.fetchClues(gameID);
|
const clues = await this.fetchClues(gameID);
|
||||||
this.clues.push(...clues);
|
this.clues.push(...clues);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user