From 2c2f241a8f18adfd205f50584e1e70cd4daa7eb6 Mon Sep 17 00:00:00 2001 From: Sketch <75850871+SketchMaster2001@users.noreply.github.com> Date: Thu, 4 Jul 2024 21:23:59 -0400 Subject: [PATCH] fix: Insert seq for concierge Miis as 1 --- theunderground/concierge.py | 3 ++- url1/mii.py | 8 +++++++- url1/special/page.py | 4 +++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/theunderground/concierge.py b/theunderground/concierge.py index 3000f9d2..c907dd66 100644 --- a/theunderground/concierge.py +++ b/theunderground/concierge.py @@ -57,7 +57,7 @@ def add_concierge(mii_id): for i in range(1, 8): msg = MiiMsgInfo( - mii_id=mii_id, type=i, msg=form[f"message{i}"].data, face=1 + mii_id=mii_id, type=i, msg=form[f"message{i}"].data, face=1, seq=1 ) db.session.add(msg) @@ -97,6 +97,7 @@ def edit_concierge(mii_id): .filter(ConciergeMiis.mii_id == mii_id) .filter(ConciergeMiis.mii_id == MiiMsgInfo.mii_id) .order_by(MiiMsgInfo.type) + .order_by(MiiMsgInfo.seq) .all() ) diff --git a/url1/mii.py b/url1/mii.py index eb6da4b2..1531138f 100644 --- a/url1/mii.py +++ b/url1/mii.py @@ -63,7 +63,13 @@ def mii_met(mii_id): # As seq/msg can repeat within a single msginfo, we add with a RepeatedKey. separate[info.type].append( - RepeatedElement({"seq": info.seq, "msg": "\n".join(wrap(info.msg, 23)), "face": info.face}) + RepeatedElement( + { + "seq": info.seq, + "msg": "\n".join(wrap(info.msg, 23)), + "face": info.face, + } + ) ) # Then, convert all separate types to our actual msginfo type. diff --git a/url1/special/page.py b/url1/special/page.py index 23fe90ce..5b91e8ff 100644 --- a/url1/special/page.py +++ b/url1/special/page.py @@ -43,7 +43,9 @@ def special_page_n(page): mii_msgs = [] for i, msg in enumerate(room_mii.mii_msg.split("\n")): - mii_msgs.append(RepeatedElement({"msgseq": i + 1, "msg": "\n".join(wrap(msg, 23))})) + mii_msgs.append( + RepeatedElement({"msgseq": i + 1, "msg": "\n".join(wrap(msg, 23))}) + ) return { "sppageid": page,