Skip to content

Commit fd27765

Browse files
authored
Division by zero (#114)
* Fix division by zero * Bump version to 2.1.12
1 parent 629c4a4 commit fd27765

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

moonraker_octoapp/moonrakerclient.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1222,7 +1222,11 @@ def GetPrintTimeRemainingEstimateInSeconds_WithPrintStatsVirtualSdCardAndGcodeMo
12221222
inverseSpeedFactorFloat = 1.0/speedFactorFloat
12231223
estimatedPrintTime = FileMetadataCache.Get().GetEstimatedPrintTimeSec(fileName)
12241224
totalFilamentUse = FileMetadataCache.Get().GetEstimatedFilamentUsageMm(fileName)
1225-
def calcTimeLeftWithProgress(printTime, progress): return (printTime / progress) - printTime
1225+
def calcTimeLeftWithProgress(printTime, progress):
1226+
if progress == 0:
1227+
return printTime
1228+
else:
1229+
return (printTime / progress) - printTime
12261230

12271231
# Can we calculate yet?
12281232
if printTime > 0:

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
# The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module
2424
# Note that this is also parsed by the moonraker module to pull the version, so the string and format must remain the same!
25-
plugin_version = "2.1.11"
25+
plugin_version = "2.1.12"
2626

2727
# The plugin's description. Can be overwritten within OctoPrint's internal data via __plugin_description__ in the plugin
2828
# module

0 commit comments

Comments
 (0)