Bug fix on incomplete JSON output on --per-chat #86

This commit is contained in:
KnugiHK
2024-09-07 18:30:38 +08:00
parent 1760dea0f5
commit fb5a1c3e1f

View File

@@ -579,7 +579,7 @@ def main():
else:
contact = jik.replace('+', '')
with open(f"{args.json}/{contact}.json", "w") as f:
file_content_to_write = json.dumps(data[jik], ensure_ascii=not args.avoid_encoding_json, indent=2 if args.pretty_print_json else None)
file_content_to_write = json.dumps({jik: data[jik]}, ensure_ascii=not args.avoid_encoding_json, indent=2 if args.pretty_print_json else None)
f.write(file_content_to_write)
print(f"Writing JSON file...({index + 1}/{total})", end="\r")
print()