diff --git a/novelwriter/core/storage.py b/novelwriter/core/storage.py index 2b96c21b..6d250e12 100644 --- a/novelwriter/core/storage.py +++ b/novelwriter/core/storage.py @@ -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: diff --git a/novelwriter/tools/writingstats.py b/novelwriter/tools/writingstats.py index 31f91ba7..7d224469 100644 --- a/novelwriter/tools/writingstats.py +++ b/novelwriter/tools/writingstats.py @@ -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()