Permalink
Browse files

get ranked events from metadata

  • Loading branch information...
Manuel-777 committed Feb 1, 2019
1 parent 6d0ea3b commit 6b60a377525f6e74046740845ad77d0b75bd4805
Showing with 8 additions and 7 deletions.
  1. +4 −7 window_background/background.js
  2. +1 −0 window_background/http-api.js
  3. +1 −0 window_main/renderer.js
  4. +2 −0 window_overlay/overlay.js
@@ -397,13 +397,10 @@ function requestHistorySend(state) {
}
}

const RANKED_DRAFT_EVENT_CODES = [
"QuickDraft_M19_20190118",
"QuickDraft_RIX_20190104",
"QuickDraft_GRN_20181221"
var ranked_events = [
"QuickDraft_M19_20190118"
];
// code and time when ranked draft _started_
var UNRANKED_RANKED_CHANGE_CODE = "QuickDraft_DOM_12072018";

var season_starts = new Date("2019-01-31T17:05:00Z");
var season_ends = null;

@@ -454,7 +451,7 @@ function calculateRankWins() {
let struct;
if (match.eventId == "Ladder" || match.eventId == "Traditional_Ladder") {
struct = rankwinrates.constructed;
} else if (RANKED_DRAFT_EVENT_CODES.includes(match.eventId)) {
} else if (ranked_events.includes(match.eventId)) {
struct = rankwinrates.limited;
} else {
continue;
@@ -163,6 +163,7 @@ function httpBasic() {
delete parsedResult.ok;
setsList = parsedResult.sets;
eventsList = parsedResult.events;
ranked_events = parsedResult.ranked_events;
ipc_send("set_db", parsedResult);
cardsDb.set(parsedResult);
ipc_send("popup", {"text": "Metadata: Ok", "time": 1000});
@@ -188,6 +188,7 @@ ipc.on('set_db', function (event, arg) {
eventsList = arg.events;
delete arg.sets;
delete arg.events;
delete arg.ranked_events;
canLogin = true;
cardsDb.set(arg);

@@ -154,6 +154,8 @@ function recreateClock() {
ipc.on('set_db', function (event, arg) {
setsList = arg.sets;
delete arg.sets;
delete arg.events;
delete arg.ranked_events;
cardsDb.set(arg);
});

0 comments on commit 6b60a37

Please sign in to comment.