summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/App.vue3
-rw-r--r--src/report-service.js8
2 files changed, 8 insertions, 3 deletions
diff --git a/src/App.vue b/src/App.vue
index ff6d081..4dcf698 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -19,7 +19,7 @@
<div class="container">
<div class="content has-text-centered">
<p>
- Last update: 2018-05-22, with {{ totalMatches }} matches total.
+ Last update: {{ lastUpdate }}, with {{ totalMatches }} matches total.
Join the <a href="https://discord.gg/txTchJY">Discord Server</a> if you have questions.
</p>
<p>
@@ -56,6 +56,7 @@ export default {
data: function() {
return {
totalMatches: Math.floor(this.reportService.getTotalMatches()/100)*100,
+ lastUpdate: this.reportService.getLastUpdate(),
};
},
};
diff --git a/src/report-service.js b/src/report-service.js
index 000080c..2469ea9 100644
--- a/src/report-service.js
+++ b/src/report-service.js
@@ -1,12 +1,12 @@
import * as maps from './maps/maps';
-const MODES = [ 'casual_aral', 'blitz_pvp_ranked', 'ranked', '5v5_pvp_ranked' ];
const POPULAR_THRESHOLD = 1.0; // percent
export default class ReportService {
constructor() {
this.report = require('../data/95fb1cdb/report.json')
.filter((entry) => entry.Actor != undefined); // bad data from API downtime
+ this.metadata = require('../data/95fb1cdb/metadata.json');
this.reports = new Map();
this.totalPicks = new Map();
@@ -21,7 +21,7 @@ export default class ReportService {
this.topUnpopularWins = new Map();
this.totalMatches = 0;
this.actors = [];
- this.modes = MODES;
+ this.modes = this.metadata.config.api.modes;
for(let mode of this.modes) {
const relevancy = (entry) => (entry.Count / this.totalPicks.get(mode)) * entry.Winner;
@@ -126,4 +126,8 @@ export default class ReportService {
getTotalMatches() {
return this.totalMatches;
}
+
+ getLastUpdate() {
+ return this.metadata.lastUpdate;
+ }
}