Skip to content

Commit

Permalink
新增对局信息页 战绩获取失败时的判断, 战绩部分留空但保证其他功能正常
Browse files Browse the repository at this point in the history
  • Loading branch information
Hpero4 committed Sep 27, 2023
1 parent 0cc0876 commit 1def451
Showing 1 changed file with 20 additions and 17 deletions.
37 changes: 20 additions & 17 deletions app/view/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -1039,23 +1039,26 @@ def process_item(item):
origRankInfo = connector.getRankedStatsByPuuid(puuid)
rankInfo = processRankInfo(origRankInfo)

origGamesInfo = connector.getSummonerGamesByPuuid(
puuid, 0, 14)

if cfg.get(cfg.gameInfoFilter) and queueId in (420, 440):
origGamesInfo["games"] = [
game for game in origGamesInfo["games"] if game["queueId"] in (420, 440)]
begIdx = 15
while len(origGamesInfo["games"]) < 11:
endIdx = begIdx + 5
origGamesInfo["games"].extend([
game for game in connector.getSummonerGamesByPuuid(puuid, begIdx, endIdx)["games"]
if game["queueId"] in (420, 440)
])
begIdx = endIdx + 1

gamesInfo = [processGameData(game)
for game in origGamesInfo["games"][0:11]]
try:
origGamesInfo = connector.getSummonerGamesByPuuid(
puuid, 0, 14)

if cfg.get(cfg.gameInfoFilter) and queueId in (420, 440):
origGamesInfo["games"] = [
game for game in origGamesInfo["games"] if game["queueId"] in (420, 440)]
begIdx = 15
while len(origGamesInfo["games"]) < 11:
endIdx = begIdx + 5
origGamesInfo["games"].extend([
game for game in connector.getSummonerGamesByPuuid(puuid, begIdx, endIdx)["games"]
if game["queueId"] in (420, 440)
])
begIdx = endIdx + 1
except SummonerGamesNotFound:
gamesInfo = []
else:
gamesInfo = [processGameData(game)
for game in origGamesInfo["games"][0:11]]

_, kill, deaths, assists, _, _ = parseGames(gamesInfo)

Expand Down

0 comments on commit 1def451

Please sign in to comment.