Skip to content

Commit

Permalink
[API] Fix compatibility with editor v1 if uncompress_document=True
Browse files Browse the repository at this point in the history
  • Loading branch information
Aedial committed Jun 2, 2024
1 parent 152f32c commit dda89ca
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions novelai_api/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,10 @@ def decrypt_user_data(
item["decrypted"] = True
item["compressed"] = is_compressed

if uncompress_document and "document" in data:
document = data.get("document")
if uncompress_document and isinstance(document, str):
unpacker.restore_state(unpacker_state)
data["document"] = unpacker.unpack(b64decode(data["document"]))
data["document"] = unpacker.unpack(b64decode(document))

continue

Expand Down

0 comments on commit dda89ca

Please sign in to comment.