forked from rDrama/rDrama
loserboard
parent
bb89f191e8
commit
6a40271e5d
|
@ -38,7 +38,7 @@ def leaderboard_thread():
|
||||||
users12 = sorted(users12, key=lambda x: x[1], reverse=True)[:25]
|
users12 = sorted(users12, key=lambda x: x[1], reverse=True)[:25]
|
||||||
userss12 = users12[:25]
|
userss12 = users12[:25]
|
||||||
|
|
||||||
if SITE == 'rdrama.net':
|
if SITE_NAME == 'Drama':
|
||||||
topmakers = {}
|
topmakers = {}
|
||||||
for k, val in marseys.items():
|
for k, val in marseys.items():
|
||||||
if val in topmakers: topmakers[val] += 1
|
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()
|
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]
|
pos10 = g.db.query(sq.c.id, sq.c.rank).filter(sq.c.id == v.id).limit(1).one()[1]
|
||||||
|
|
||||||
|
try:
|
||||||
pos9 = [x[0].id for x in users9].index(v.id)
|
pos9 = [x[0].id for x in users9].index(v.id)
|
||||||
pos9 = (pos9+1, users9[pos9][1])
|
pos9 = (pos9+1, users9[pos9][1])
|
||||||
|
except: pos9 = (len(users9)+1, 0)
|
||||||
|
|
||||||
|
try:
|
||||||
pos12 = [x[0].id for x in users12].index(v.id)
|
pos12 = [x[0].id for x in users12].index(v.id)
|
||||||
pos12 = (pos12+1, users12[pos12][1])
|
pos12 = (pos12+1, users12[pos12][1])
|
||||||
|
except: pos12 = (len(users12)+1, 0)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
pos13 = [x[0].id for x in users13].index(v.id)
|
pos13 = [x[0].id for x in users13].index(v.id)
|
||||||
pos13 = (pos13+1, users13[pos13][1])
|
pos13 = (pos13+1, users13[pos13][1])
|
||||||
except: pos13 = None
|
except: pos13 = (len(users13)+1, 0)
|
||||||
|
|
||||||
|
try:
|
||||||
pos15 = [x[0].id for x in users15].index(v.id)
|
pos15 = [x[0].id for x in users15].index(v.id)
|
||||||
pos15 = (pos15+1, users15[pos15][1])
|
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)
|
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…
Reference in New Issue