def viewscores(userid: UserID) -> Response: frontend = ReflecBeatFrontend(g.data, g.config, g.cache) info = frontend.get_latest_player_info([userid]).get(userid) if info is None: abort(404) scores = frontend.get_scores(userid, limit=100) if len(scores) > 10: scores = frontend.round_to_ten(scores) return render_react( '{}\'s Reflec Beat Scores'.format(info['name']), 'reflec/scores.react.js', { 'attempts': scores, 'songs': frontend.get_all_songs(), 'players': {}, 'shownames': False, 'shownewrecords': True, }, { 'refresh': url_for('reflec_pages.listscores', userid=userid), 'player': url_for('reflec_pages.viewplayer', userid=-1), 'individual_score': url_for('reflec_pages.viewtopscores', musicid=-1), }, )
def listscores(userid: UserID) -> Dict[str, Any]: frontend = ReflecBeatFrontend(g.data, g.config, g.cache) return { 'attempts': frontend.get_scores(userid), 'players': {}, }