Skip to content
This repository was archived by the owner on Jun 25, 2024. It is now read-only.

Commit 0a631c7

Browse files
committed
修正部分錯誤
1 parent 4ef9cc0 commit 0a631c7

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

utils/fetch_rank.py

+9-6
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,15 @@ async def nonplume(self):
126126
self.logger.error(f"Error {name} ({id})")
127127

128128
nonplume = {}
129-
nonplume["pvp"] = row[cols["pvp"]]["v"]
130-
nonplume["cb"] = row[cols["cb"]]["v"]
131-
nonplume["preferRank"] = row[cols["preferRank"]]["v"] if row[cols["preferRank"]] else "-"
132-
nonplume["preferRarity"] = row[cols["preferRarity"]]["v"]
133-
nonplume["comment"] = row[cols["comment"]]["v"]
134-
self.result[id]["nonplume"] = nonplume
129+
try:
130+
nonplume["pvp"] = row[cols["pvp"]]["v"]
131+
nonplume["cb"] = row[cols["cb"]]["v"]
132+
nonplume["preferRank"] = row[cols["preferRank"]]["v"] if row[cols["preferRank"]] else "-"
133+
nonplume["preferRarity"] = row[cols["preferRarity"]]["v"]
134+
nonplume["comment"] = row[cols["comment"]]["v"]
135+
self.result[id]["nonplume"] = nonplume
136+
except:
137+
pass
135138

136139
self.source["nonplume"] = f"https://docs.google.com/spreadsheets/d/{self.nonplume_sheet['key']}/htmlview"
137140

utils/game_data.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def get_featured_gacha_pickup(self) -> dict:
3535
CASE a.rarity_odds WHEN 600000 THEN 1 ELSE 0 END rarity3_double
3636
FROM gacha_data a
3737
WHERE a.exchange_id != 0 AND a.gacha_times_limit10 != 1 AND (a.prizegacha_id != 0 OR a.gacha_bonus_id != 0) AND REPLACE(a.start_time, '/', '-') <= datetime('now', '+8 hours')
38-
ORDER BY a.start_time DESC LIMIT 1
38+
ORDER BY a.start_time DESC, a.gacha_bonus_id DESC LIMIT 1
3939
""",
4040
).fetchone()
4141
data["unit_ids"] = [int(i[:4]) for i in data.get("unit_ids").split(",")]

0 commit comments

Comments
 (0)