Fix minor issue in session log conversion
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user