mirror of
https://github.com/drmext/MonkeyBusiness.git
synced 2024-11-27 17:00:59 +01:00
Fix slow loading IIDX records
This commit is contained in:
parent
381b26b152
commit
cd23cef87f
@ -58,7 +58,6 @@ async def iidx29music_getrank(request: Request):
|
||||
& (where("play_style") == play_style)
|
||||
& (where("iidx_id") == iidxid)
|
||||
):
|
||||
|
||||
music_id = record["music_id"]
|
||||
clear_flg = record["clear_flg"]
|
||||
ex_score = record["ex_score"]
|
||||
@ -78,6 +77,15 @@ async def iidx29music_getrank(request: Request):
|
||||
all_scores[rival_idx, music_id][chart_id]["ex_score"] = ex_score
|
||||
all_scores[rival_idx, music_id][chart_id]["miss_count"] = miss_count
|
||||
|
||||
names = {}
|
||||
profiles = get_db().table("iidx_profile")
|
||||
for p in profiles:
|
||||
names[p["iidx_id"]] = {}
|
||||
try:
|
||||
names[p["iidx_id"]]["name"] = p["version"][str(game_version)]["djname"]
|
||||
except KeyError:
|
||||
names[p["iidx_id"]]["name"] = "UNK"
|
||||
|
||||
top_scores = {}
|
||||
for record in db.table("iidx_scores_best").search(
|
||||
(where("music_id") < (game_version + 1) * 1000)
|
||||
@ -98,10 +106,7 @@ async def iidx29music_getrank(request: Request):
|
||||
}
|
||||
|
||||
if ex_score > top_scores[music_id][chart_id]["ex_score"]:
|
||||
top_name = db.table("iidx_profile").get(where("iidx_id") == iidx_id)[
|
||||
"version"
|
||||
][str(game_version)]["djname"]
|
||||
top_scores[music_id][chart_id]["djname"] = top_name
|
||||
top_scores[music_id][chart_id]["djname"] = names[iidx_id]["name"]
|
||||
top_scores[music_id][chart_id]["clear_flg"] = 1
|
||||
top_scores[music_id][chart_id]["ex_score"] = ex_score
|
||||
|
||||
|
@ -59,7 +59,6 @@ async def iidx30music_getrank(request: Request):
|
||||
& (where("play_style") == play_style)
|
||||
& (where("iidx_id") == iidxid)
|
||||
):
|
||||
|
||||
music_id = record["music_id"]
|
||||
clear_flg = record["clear_flg"]
|
||||
ex_score = record["ex_score"]
|
||||
@ -79,6 +78,15 @@ async def iidx30music_getrank(request: Request):
|
||||
all_scores[rival_idx, music_id][chart_id]["ex_score"] = ex_score
|
||||
all_scores[rival_idx, music_id][chart_id]["miss_count"] = miss_count
|
||||
|
||||
names = {}
|
||||
profiles = get_db().table("iidx_profile")
|
||||
for p in profiles:
|
||||
names[p["iidx_id"]] = {}
|
||||
try:
|
||||
names[p["iidx_id"]]["name"] = p["version"][str(game_version)]["djname"]
|
||||
except KeyError:
|
||||
names[p["iidx_id"]]["name"] = "UNK"
|
||||
|
||||
top_scores = {}
|
||||
for record in db.table("iidx_scores_best").search(
|
||||
(where("music_id") < (game_version + 1) * 1000)
|
||||
@ -99,10 +107,7 @@ async def iidx30music_getrank(request: Request):
|
||||
}
|
||||
|
||||
if ex_score > top_scores[music_id][chart_id]["ex_score"]:
|
||||
top_name = db.table("iidx_profile").get(where("iidx_id") == iidx_id)[
|
||||
"version"
|
||||
][str(game_version)]["djname"]
|
||||
top_scores[music_id][chart_id]["djname"] = top_name
|
||||
top_scores[music_id][chart_id]["djname"] = names[iidx_id]["name"]
|
||||
top_scores[music_id][chart_id]["clear_flg"] = 1
|
||||
top_scores[music_id][chart_id]["ex_score"] = ex_score
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user