master.py: also update title CSS
This commit is contained in:
parent
59236cac70
commit
64a6f270c5
|
@ -175,14 +175,21 @@ def update_trophies():
|
|||
# Add missing trophies
|
||||
for name, t in tr.items():
|
||||
description = t.get("description", "")
|
||||
css = t.get("css", "")
|
||||
trophy = Trophy.query.filter_by(name=name).first()
|
||||
|
||||
if "css" in t and not t["is_title"]:
|
||||
print(f"[trophies] CSS on '{name}' is meaningless (not a title)")
|
||||
|
||||
# Updating existing trophies
|
||||
if trophy is not None:
|
||||
changes = (trophy.description != description) or \
|
||||
(trophy.hidden != t["hidden"])
|
||||
(trophy.hidden != t["hidden"] or (isinstance(trophy,Title) and \
|
||||
trophy.css != css))
|
||||
trophy.description = description
|
||||
trophy.hidden = t["hidden"]
|
||||
if isinstance(trophy, Title):
|
||||
trophy.css = css
|
||||
if changes:
|
||||
print(f"[trophies] Updated '{name}'")
|
||||
|
||||
|
|
Loading…
Reference in New Issue