Skip to content

Commit

Permalink
fix: Insert seq for concierge Miis as 1
Browse files Browse the repository at this point in the history
  • Loading branch information
noahpistilli committed Jul 5, 2024
1 parent f95ed4e commit 2c2f241
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
3 changes: 2 additions & 1 deletion theunderground/concierge.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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()
)

Expand Down
8 changes: 7 additions & 1 deletion url1/mii.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 3 additions & 1 deletion url1/special/page.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 2c2f241

Please sign in to comment.