mirror of
https://github.com/misenhower/splatoon3.ink.git
synced 2026-08-22 08:34:30 -05:00
Cleanup
This commit is contained in:
@@ -2,23 +2,20 @@ import GearUpdater from "./updaters/GearUpdater.mjs";
|
||||
import StageScheduleUpdater from "./updaters/StageScheduleUpdater.mjs";
|
||||
import CoopUpdater from "./updaters/CoopUpdater.mjs";
|
||||
import FestivalUpdater from "./updaters/FestivalUpdater.mjs";
|
||||
import { regionTokens } from "../splatnet/NsoClient.mjs";
|
||||
import XRankUpdater from "./updaters/XRankUpdater.mjs";
|
||||
import StagesUpdater from "./updaters/StagesUpdater.mjs";
|
||||
|
||||
function updaters() {
|
||||
const tokens = regionTokens();
|
||||
|
||||
return [
|
||||
new StageScheduleUpdater,
|
||||
new GearUpdater,
|
||||
new CoopUpdater,
|
||||
tokens.US && new FestivalUpdater('US'),
|
||||
tokens.EU && new FestivalUpdater('EU'),
|
||||
tokens.JP && new FestivalUpdater('JP'),
|
||||
tokens.AP && new FestivalUpdater('AP'),
|
||||
new FestivalUpdater('US'),
|
||||
new FestivalUpdater('EU'),
|
||||
new FestivalUpdater('JP'),
|
||||
new FestivalUpdater('AP'),
|
||||
new StagesUpdater,
|
||||
].filter(u => u);
|
||||
];
|
||||
}
|
||||
|
||||
function lowPriorityUpdaters() {
|
||||
|
||||
@@ -4,6 +4,7 @@ import DataUpdater from "./DataUpdater.mjs";
|
||||
import FestivalRankingUpdater from './FestivalRankingUpdater.mjs';
|
||||
import { getFestId } from '../../common/util.mjs';
|
||||
import ValueCache from '../../common/ValueCache.mjs';
|
||||
import { regionTokens } from '../../splatnet/NsoClient.mjs';
|
||||
|
||||
function generateFestUrl(id) {
|
||||
return process.env.DEBUG ?
|
||||
@@ -45,6 +46,18 @@ export default class FestivalUpdater extends DataUpdater
|
||||
},
|
||||
];
|
||||
|
||||
shouldUpdate() {
|
||||
const tokens = regionTokens();
|
||||
|
||||
if (!tokens[this.region]) {
|
||||
this.console.log(`No token provided for ${this.region} region, skipping...`);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return super.shouldUpdate();
|
||||
}
|
||||
|
||||
async getData(locale) {
|
||||
let result = await this.splatnet(locale).getFestRecordData();
|
||||
|
||||
|
||||
@@ -48,12 +48,7 @@ export default class NsoClient
|
||||
throw new Error(`Invalid region: ${region}`);
|
||||
}
|
||||
|
||||
let token = tokens[region];
|
||||
if (!token) {
|
||||
throw new Error(`Token not set for region: ${region}`);
|
||||
}
|
||||
|
||||
return new NsoClient(region, token);
|
||||
return new NsoClient(region, tokens[region]);
|
||||
}
|
||||
|
||||
get cachePrefix() {
|
||||
|
||||
Reference in New Issue
Block a user