Skip to content

Commit 556a55e

Browse files
committed
fix: drop minutes in total print duration if days >= 100
That way things should always fit the box...
1 parent 2782681 commit 556a55e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

octoprint_wrapped/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,11 @@ def _to_duration_days(self, seconds: int) -> str:
227227
minutes = int(seconds / SECONDS_MINUTE)
228228
seconds -= minutes * SECONDS_MINUTE
229229

230-
return f"{days}d {hours}h {minutes}m"
230+
if days >= 100:
231+
# strip the minutes to keep things fitting...
232+
return f"{days}d {hours}h"
233+
else:
234+
return f"{days}d {hours}h {minutes}m"
231235

232236
def _to_duration_hours(self, seconds: int) -> str:
233237
hours = int(seconds / SECONDS_HOUR)

0 commit comments

Comments
 (0)