Fix minor issue in session log conversion

This commit is contained in:
Veronica Berglyd Olsen
2023-06-15 23:26:27 +02:00
parent 0689e977ea
commit 6193e3191b
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -480,7 +480,7 @@ class _LegacyStorage:
end=f"{bits[2]} {bits[3]}",
novel=int(bits[4]),
notes=int(bits[5]),
idle=int(bits[6]) if nBits > 6 else -1,
idle=int(bits[6]) if nBits > 6 else 0,
))
with open(sessJson, mode="a+", encoding="utf-8") as fObj:
+3 -3
View File
@@ -451,9 +451,9 @@ class GuiWritingStats(QDialog):
except Exception:
logger.error("Invalid session log record")
continue
wcNovel = checkInt(record.get("novel"), 0)
wcNotes = checkInt(record.get("notes"), 0)
sIdle = checkInt(record.get("idle"), 0)
wcNovel = max(checkInt(record.get("novel"), 0), 0)
wcNotes = max(checkInt(record.get("notes"), 0), 0)
sIdle = max(checkInt(record.get("idle"), 0), 0)
tDiff = dEnd - dStart
sDiff = tDiff.total_seconds()