diff --git a/bemani/frontend/danevo/danevo.py b/bemani/frontend/danevo/danevo.py index 0f247ef..24ebf5e 100644 --- a/bemani/frontend/danevo/danevo.py +++ b/bemani/frontend/danevo/danevo.py @@ -76,6 +76,7 @@ class DanceEvolutionFrontend(FrontendBase): formatted_song["levels"] = levels formatted_song["bpm_min"] = song.data.get_int("bpm_min") formatted_song["bpm_max"] = song.data.get_int("bpm_max") + formatted_song["kcal"] = song.data.get_float("kcal") return formatted_song def merge_song(self, existing: Dict[str, Any], new: Song) -> Dict[str, Any]: diff --git a/bemani/frontend/danevo/endpoints.py b/bemani/frontend/danevo/endpoints.py index edea869..2d17f80 100644 --- a/bemani/frontend/danevo/endpoints.py +++ b/bemani/frontend/danevo/endpoints.py @@ -107,6 +107,7 @@ def viewtopscores(musicid: int) -> Response: name = None artist = None genre = None + kcal = None levels = [0, 0, 0, 0, 0] for version in versions: @@ -119,6 +120,8 @@ def viewtopscores(musicid: int) -> Response: artist = details.artist if genre is None: genre = details.genre + if kcal is None: + kcal = details.data.get_float("kcal") if levels[chart] == 0: levels[chart] = details.data.get_int("level") @@ -136,6 +139,7 @@ def viewtopscores(musicid: int) -> Response: "artist": artist, "genre": genre, "levels": levels, + "kcal": kcal, "players": top_scores["players"], "topscores": top_scores["topscores"], }, diff --git a/bemani/frontend/static/controllers/danevo/records.react.js b/bemani/frontend/static/controllers/danevo/records.react.js index 5f3a05c..344251a 100644 --- a/bemani/frontend/static/controllers/danevo/records.react.js +++ b/bemani/frontend/static/controllers/danevo/records.react.js @@ -110,11 +110,19 @@ var network_records = createReactClass({ ); }, - renderLevel: function(songid, chart) { - if (this.state.songs[songid].levels[chart] == 0) { + renderLevel: function(songid) { + if (this.state.songs[songid].levels[0] == 0) { return --; } else { - return {this.state.songs[songid].levels[chart]}; + return {this.state.songs[songid].levels[0]}; + } + }, + + renderKcal: function(songid) { + if (this.state.songs[songid].kcal <= 0.0) { + return --; + } else { + return {this.state.songs[songid].kcal}; } }, @@ -180,7 +188,7 @@ var network_records = createReactClass({