mirror of
https://github.com/FAUSheppy/open-web-leaderboard.git
synced 2025-12-07 23:51:36 +01:00
fix player not found case
This commit is contained in:
@@ -89,12 +89,12 @@ def leaderboard():
|
|||||||
if playerName:
|
if playerName:
|
||||||
playersWithRankUrl = FIND_PLAYER.format(server=SERVER, pname=playerName)
|
playersWithRankUrl = FIND_PLAYER.format(server=SERVER, pname=playerName)
|
||||||
playersWithRank = str(requests.get(playersWithRankUrl).content, "utf-8").split("\n")
|
playersWithRank = str(requests.get(playersWithRankUrl).content, "utf-8").split("\n")
|
||||||
searchName, playerID, rating, games, win, rank = playersWithRank[0].split(SEPERATOR)
|
|
||||||
|
|
||||||
if len(playersWithRank) == 1 and playersWithRank[0] == "":
|
if len(playersWithRank) == 1 and playersWithRank[0] == "":
|
||||||
cannotFindPlayer = flask.Markup("<div class=noPlayerFound>No player of that name</div>")
|
cannotFindPlayer = flask.Markup("<div class=noPlayerFound>No player of that name</div>")
|
||||||
start = 0
|
start = 0
|
||||||
else:
|
else:
|
||||||
|
searchName, playerID, rating, games, win, rank = playersWithRank[0].split(SEPERATOR)
|
||||||
rank = int(rank)
|
rank = int(rank)
|
||||||
start = rank - (rank % SEGMENT)
|
start = rank - (rank % SEGMENT)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user