loserboard
This commit is contained in:
parent
a6ec64f848
commit
4e3f5b203b
1 changed files with 14 additions and 8 deletions
|
@ -38,7 +38,7 @@ def leaderboard_thread():
|
|||
users12 = sorted(users12, key=lambda x: x[1], reverse=True)[:25]
|
||||
userss12 = users12[:25]
|
||||
|
||||
if SITE == 'rdrama.net':
|
||||
if SITE_NAME == 'Drama':
|
||||
topmakers = {}
|
||||
for k, val in marseys.items():
|
||||
if val in topmakers: topmakers[val] += 1
|
||||
|
@ -364,19 +364,25 @@ def leaderboard(v):
|
|||
sq = g.db.query(User.id, func.rank().over(order_by=User.truecoins.desc()).label("rank")).subquery()
|
||||
pos10 = g.db.query(sq.c.id, sq.c.rank).filter(sq.c.id == v.id).limit(1).one()[1]
|
||||
|
||||
pos9 = [x[0].id for x in users9].index(v.id)
|
||||
pos9 = (pos9+1, users9[pos9][1])
|
||||
try:
|
||||
pos9 = [x[0].id for x in users9].index(v.id)
|
||||
pos9 = (pos9+1, users9[pos9][1])
|
||||
except: pos9 = (len(users9)+1, 0)
|
||||
|
||||
pos12 = [x[0].id for x in users12].index(v.id)
|
||||
pos12 = (pos12+1, users12[pos12][1])
|
||||
try:
|
||||
pos12 = [x[0].id for x in users12].index(v.id)
|
||||
pos12 = (pos12+1, users12[pos12][1])
|
||||
except: pos12 = (len(users12)+1, 0)
|
||||
|
||||
try:
|
||||
pos13 = [x[0].id for x in users13].index(v.id)
|
||||
pos13 = (pos13+1, users13[pos13][1])
|
||||
except: pos13 = None
|
||||
except: pos13 = (len(users13)+1, 0)
|
||||
|
||||
pos15 = [x[0].id for x in users15].index(v.id)
|
||||
pos15 = (pos15+1, users15[pos15][1])
|
||||
try:
|
||||
pos15 = [x[0].id for x in users15].index(v.id)
|
||||
pos15 = (pos15+1, users15[pos15][1])
|
||||
except: pos15 = (len(users15)+1, 0)
|
||||
|
||||
return render_template("leaderboard.html", v=v, users1=users1, pos1=pos1, users2=users2, pos2=pos2, users3=users3, pos3=pos3, users4=users4, pos4=pos4, users5=users5, pos5=pos5, users6=users6, pos6=pos6, users7=users7, pos7=pos7, users9=userss9, pos9=pos9, users10=users10, pos10=pos10, users12=userss12, pos12=pos12, users13=userss13, pos13=pos13, users15=userss15, pos15=pos15)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue