Пример #1
0
def viewscores(userid: UserID) -> Response:
    frontend = PopnMusicFrontend(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 Pop\'n Music Scores'.format(info['name']),
        'popn/scores.react.js',
        {
            'attempts': scores,
            'songs': frontend.get_all_songs(),
            'players': {},
            'shownames': False,
            'shownewrecords': True,
        },
        {
            'refresh': url_for('popn_pages.listscores', userid=userid),
            'player': url_for('popn_pages.viewplayer', userid=-1),
            'individual_score': url_for('popn_pages.viewtopscores',
                                        musicid=-1),
        },
    )
Пример #2
0
def listscores(userid: UserID) -> Dict[str, Any]:
    frontend = PopnMusicFrontend(g.data, g.config, g.cache)
    return {
        'attempts': frontend.get_scores(userid),
        'players': {},
    }