Archived
1
0
Fork 0

minor changes

This commit is contained in:
yzhh 2022-01-20 19:23:12 +08:00
parent d117a99f0a
commit 0cc23dcec7
3 changed files with 15 additions and 6 deletions

View file

@ -24,11 +24,14 @@ def dsimg(img, rank, name, difficulty, score, ptt, realptt, pure, far, lost, pla
else:
scoretype = 'D'
# song ptt
realptt = realptt / 10
if ptt > realptt or ptt < realptt:
ptt = f'{realptt} > {round(ptt, 4)}'
if ptt > 0:
realptt = realptt / 10
if ptt > realptt or ptt < realptt:
ptt = f'{realptt} > {round(ptt, 4)}'
else:
ptt = str(realptt)
else:
ptt = str(realptt)
ptt = f'??? > {round(ptt, 4)}'
# playtime
nowtime = time.time()
playtime = playtime // 1000 - nowtime

View file

@ -86,7 +86,10 @@ async def getb30_official(usercode):
potential_value -= 1 + (score - 9800000) / 200000
elif score <= 9500000:
potential_value -= (score - 9500000) / 300000
realptt = round(potential_value, 1) * 10
if potential_value <= 0:
realptt = -1
else:
realptt = round(potential_value, 1) * 10
ptt = x['potential_value']
ptts[x['song_id'] + difficulty] = ptt
scores[x['song_id'] + difficulty] = score
@ -114,7 +117,8 @@ async def getb30_official(usercode):
realptt = realptts[last5['song_id'] + difficulty]
ptt = ptts[last5['song_id'] + difficulty]
score = scores[last5['song_id'] + difficulty]
last5list += f'[{last5rank}] {trackname}\n[{last5rank}] {score} / {realptt / 10} -> {round(ptt, 4)}\n'
last5list += f'[{last5rank}] {trackname}\n' \
f'[{last5rank}] {score} / {(realptt / 10) if realptt > 0 else "???(cant calc since score is too low)"} -> {round(ptt, 4)}\n'
print(last5list)
filename = drawb30(username, b30_avg, r10_avg, potential, 0, newdir, official=True)
filelist = os.listdir(newdir)

View file

@ -61,6 +61,8 @@ async def get_info_official(usercode):
ptt += 1 + (score - 9800000) / 200000
elif score <= 9500000:
ptt += (score - 9500000) / 300000
if ptt <= 0:
realptt = "???(can't calc since score is too low)"
shiny_pure = recent['shiny_pure_count']
pure = recent['pure_count']