diff --git a/.gitignore b/.gitignore index e9aa60e..569e82a 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ node_modules dist database/config.json +database/advertisement.json # local env files diff --git a/database/main.py b/database/main.py index 6477333..9977d3b 100644 --- a/database/main.py +++ b/database/main.py @@ -5,4 +5,5 @@ from app import app import asyncio -app.run(host='0.0.0.0', port=8333, loop=asyncio.get_event_loop(), use_reloader=False) +if __name__ == "__main__": + app.run(host='0.0.0.0', port=8333, loop=asyncio.get_event_loop(), use_reloader=False) diff --git a/database/models/maimai.py b/database/models/maimai.py index 0874f67..b751d7e 100644 --- a/database/models/maimai.py +++ b/database/models/maimai.py @@ -114,12 +114,15 @@ def get_plate_name(version, plate_type): "maimai MiLK": "白", "MiLK PLUS": "雪", "maimai FiNALE": "輝", + "ALL FiNALE": "舞", "maimai でらっくす": "熊", "maimai でらっくす PLUS": "華", "maimai でらっくす Splash": "爽", "maimai でらっくす Splash PLUS": "煌", "maimai でらっくす UNiVERSE": "宙", - "maimai でらっくす UNiVERSE PLUS": "星" + "maimai でらっくす UNiVERSE PLUS": "星", + "maimai でらっくす FESTiVAL": "祭", + "maimai でらっくす FESTiVAL PLUS": "祝" }[version]+{ 1: "極", 2: "将", @@ -173,6 +176,9 @@ def record_json(record: NewRecord, masked: bool): "ds": record.ds, "song_id": record.id } + if data["song_id"] >= 100000: + data["ra"] = 0 + data["level_label"] = "Utage" return data diff --git a/database/routes/maimai.py b/database/routes/maimai.py index 706af9e..6bb206b 100644 --- a/database/routes/maimai.py +++ b/database/routes/maimai.py @@ -180,6 +180,25 @@ async def get_records(): } +@app.route("/player/test_data", methods=['GET']) +async def get_records_test(): + r = NewRecord.raw('select newrecord.achievements, newrecord.fc, newrecord.fs, newrecord.dxScore, chart.ds as ds, chart.level as level, chart.difficulty as diff, music.type as `type`, music.id as `id`, music.is_new as is_new, music.title as title from newrecord, chart, music where player_id = %s and chart_id = chart.id and chart.music_id = music.id', '636') + user = Player.get(Player.id == 636) + await compute_ra(user) + records = [] + for record in r: + elem = record_json(record, False) + records.append(elem) + return { + "username": "DivingFish", + "rating": user.rating, + "additional_rating": user.additional_rating, + "nickname": user.nickname, + "plate": user.plate, + "records": records + } + + @app.route("/dev/player/records", methods=['GET']) @developer_required async def dev_get_records(): @@ -270,7 +289,7 @@ def get_dx_and_sd(player): def get_dx_and_sd_for50(player): - l = NewRecord.raw('select newrecord.achievements, newrecord.fc, newrecord.fs, newrecord.dxScore, chart.ds as ds, chart.level as level, chart.difficulty as diff, music.type as `type`, music.id as `id`, music.is_new as is_new, music.title as title from newrecord, chart, music where player_id = %s and chart_id = chart.id and chart.music_id = music.id', player.id) + l = NewRecord.raw('select newrecord.achievements, newrecord.fc, newrecord.fs, newrecord.dxScore, chart.ds as ds, chart.level as level, chart.difficulty as diff, music.type as `type`, music.id as `id`, music.is_new as is_new, music.title as title from newrecord, chart, music where player_id = %s and chart_id = chart.id and chart.music_id = music.id and chart.music_id < 100000', player.id) l1 = [] l2 = [] for r in l: diff --git a/web/src/components/ChartTable.vue b/web/src/components/ChartTable.vue index 41d8d45..3c63fa4 100644 --- a/web/src/components/ChartTable.vue +++ b/web/src/components/ChartTable.vue @@ -140,44 +140,44 @@ :color="getLevel(item.level_index)" dark > - {{ item.level_label }} {{ item.level }} + {{ item.level_label }} {{ item.level }}{{ item.song_id > 100000 ? '?' : '' }} Charter: - {{ music_data_dict[item.song_id].charts[item.level_index].charter }} + {{ music_data_dict[item.song_id].charts[getActualLevelIndex(item)].charter }}
Tap: {{ - music_data_dict[item.song_id].charts[item.level_index].notes[0] + music_data_dict[item.song_id].charts[getActualLevelIndex(item)].notes[0] }}
Hold: {{ - music_data_dict[item.song_id].charts[item.level_index].notes[1] + music_data_dict[item.song_id].charts[getActualLevelIndex(item)].notes[1] }}
Slide: {{ - music_data_dict[item.song_id].charts[item.level_index].notes[2] + music_data_dict[item.song_id].charts[getActualLevelIndex(item)].notes[2] }}
Touch: {{ - music_data_dict[item.song_id].charts[item.level_index].notes[3] + music_data_dict[item.song_id].charts[getActualLevelIndex(item)].notes[3] }}
Break: {{ - music_data_dict[item.song_id].charts[item.level_index].notes[4] + music_data_dict[item.song_id].charts[getActualLevelIndex(item)].notes[4] }}
Break: {{ - music_data_dict[item.song_id].charts[item.level_index].notes[3] + music_data_dict[item.song_id].charts[getActualLevelIndex(item)].notes[3] }}
@@ -211,7 +211,7 @@