예제 #1
0
def viewscores(userid: UserID) -> Response:
    frontend = IIDXFrontend(g.data, g.config, g.cache)
    djinfo = frontend.get_latest_player_info([userid]).get(userid)
    if djinfo is None:
        abort(404)

    scores = frontend.get_scores(userid, limit=100)
    if len(scores) > 10:
        scores = frontend.round_to_ten(scores)

    return render_react(
        f'dj {djinfo["name"]}\'s IIDX Scores',
        'iidx/scores.react.js',
        {
            'attempts': scores,
            'songs': frontend.get_all_songs(),
            'players': {},
            'versions':
            {version: name
             for (game, version, name) in frontend.all_games()},
            'showdjnames': False,
            'shownewrecords': True,
        },
        {
            'refresh': url_for('iidx_pages.listscores', userid=userid),
            'player': url_for('iidx_pages.viewplayer', userid=-1),
            'individual_score': url_for('iidx_pages.viewtopscores',
                                        musicid=-1),
        },
    )
예제 #2
0
def viewrecords(userid: UserID) -> Response:
    frontend = IIDXFrontend(g.data, g.config, g.cache)
    djinfo = frontend.get_latest_player_info([userid]).get(userid)
    if djinfo is None:
        abort(404)

    return render_react(
        f'dj {djinfo["name"]}\'s IIDX Records',
        'iidx/records.react.js',
        {
            'records': frontend.get_records(userid),
            'songs': frontend.get_all_songs(),
            'players': {},
            'versions':
            {version: name
             for (game, version, name) in frontend.all_games()},
            'showdjnames': False,
            'showpersonalsort': True,
            'filterempty': True,
        },
        {
            'refresh': url_for('iidx_pages.listrecords', userid=userid),
            'player': url_for('iidx_pages.viewplayer', userid=-1),
            'individual_score': url_for('iidx_pages.viewtopscores',
                                        musicid=-1),
        },
    )