Skip to content

Commit

Permalink
should have tested this
Browse files Browse the repository at this point in the history
  • Loading branch information
jayceslesar committed Apr 9, 2024
1 parent 6e3c792 commit 6f46e16
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions masterbase/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,13 +300,11 @@ def demodata_helper(engine: Engine, api_key: str, session_id: str) -> Generator[
bytestream = row[1].tobytes()
if i == 0:
sql = "SELECT late_bytes from demo_sessions where session_id = :session_id;"
_late_bytes = conn.execute(sa.text(sql), dict(session_id=session_id)).scalar_one()
if _late_bytes is None:
late_bytes = conn.execute(sa.text(sql), dict(session_id=session_id)).scalar_one()
if late_bytes is None:
logger.info(f"Session {session_id} has no late_bytes!")
yield bytestream
else:
# strip the \x from the string
late_bytes = bytes.fromhex(_late_bytes[2:])
# bytesurgeon >:D
bytestream = bytestream[:0x420] + late_bytes + bytestream[0x430:]
yield bytestream
Expand Down

0 comments on commit 6f46e16

Please sign in to comment.