Skip to content

Commit

Permalink
Fixing a status input bounds bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
QuinnDamerell committed Nov 9, 2024
1 parent 7e9b870 commit d17a241
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion bambu_octoeverywhere/bambucommandhandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ def GetCurrentJobStatus(self):
{
"Progress" : progress,
"DurationSec" : durationSec,
"TimeLeftSec" : timeLeftSec,
# In some system buggy cases, the time left can be super high and won't fit into a int32, so we cap it.
"TimeLeftSec" : min(timeLeftSec, 2147483600),
"FileName" : fileName,
"EstTotalFilUsedMm" : filamentUsageMm,
"CurrentLayer": currentLayerInt,
Expand Down
3 changes: 2 additions & 1 deletion moonraker_octoeverywhere/moonrakercommandhandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ def GetCurrentJobStatus(self):
{
"Progress" : progress,
"DurationSec" : durationSec,
"TimeLeftSec" : timeLeftSec,
# In some system buggy cases, the time left can be super high and won't fit into a int32, so we cap it.
"TimeLeftSec" : min(timeLeftSec, 2147483600),
"FileName" : fileName,
"EstTotalFilUsedMm" : filamentUsageMm,
"CurrentLayer": currentLayerInt,
Expand Down
3 changes: 2 additions & 1 deletion octoprint_octoeverywhere/octoprintcommandhandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ def GetCurrentJobStatus(self):
{
"Progress" : progress,
"DurationSec" : durationSec,
"TimeLeftSec" : timeLeftSec,
# In some system buggy cases, the time left can be super high and won't fit into a int32, so we cap it.
"TimeLeftSec" : min(timeLeftSec, 2147483600),
"FileName" : fileName,
"EstTotalFilUsedMm" : estTotalFilamentUsageMm,
"CurrentLayer": None, # OctoPrint doesn't provide these.
Expand Down

0 comments on commit d17a241

Please sign in to comment.