Browse Source

fix: negative total durations should not be possible

main
Rob Hallam 1 month ago
parent
commit
15ca7cb6fa
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      pipeline/adjusters.py

+ 4
- 0
pipeline/adjusters.py View File

@@ -55,6 +55,10 @@ class TargetTimeAdjuster(Adjuster):
target_time_max = time + (time * margin / 100)
target_time_min = time - (time * margin / 100)

# ensure we don't have negative times
if type(target_time_min) is float and target_time_min < 0:
target_time_min = 0.0

return (target_time_min, target_time_max)

def _features_total_time(self, features: list) -> float:


Loading…
Cancel
Save