diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2017-05-06 19:49:58 +0200 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2017-05-06 19:49:58 +0200 |
| commit | cdd4c7f166cbe7ca6b262d2dd4c5ad1dcc065f4a (patch) | |
| tree | 9bdd5c3e546ea857bd3fd7281f4ce3d81c7eff66 | |
| parent | 120349f4285ea2d0915720278893f12039d4e4ff (diff) | |
| download | processor-cdd4c7f166cbe7ca6b262d2dd4c5ad1dcc065f4a.tar.gz processor-cdd4c7f166cbe7ca6b262d2dd4c5ad1dcc065f4a.zip | |
use API's match.patchVersionrelease/2.3.0
| -rw-r--r-- | worker.js | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -488,13 +488,15 @@ function flatten(obj) { // hero names additionally need to be mapped old to new names // (Sayoc = Taka) p.hero_id = hero_db_map[hero_name_map[participant.actor]]; - // TODO don't hardcode this, waiting for `match.patch_version` to be available - if (p_s.created_at < new Date("2017-03-28T15:00:00")) - p.series_id = series_db_map["Patch 2.2"]; - else if (p_s.created_at < new Date("2017-04-26T15:00:00")) - p.series_id = series_db_map["Patch 2.3"]; - else - p.series_id = series_db_map["Patch 2.4"]; + if (match.patch_version != "") + p.series_id = series_db_map["Patch " + match.patch_version]; + else { + if (p_s.created_at < new Date("2017-03-28T15:00:00")) + p.series_id = series_db_map["Patch 2.2"]; + else if (p_s.created_at < new Date("2017-04-26T15:00:00")) + p.series_id = series_db_map["Patch 2.3"]; + else p.series_id = series_db_map["Patch 2.4"]; + } p.game_mode_id = game_mode_db_map[match.game_mode]; // attributes to copy from API to participant |
