From cff4bc1abe781006bfb340bfc684820697df573e Mon Sep 17 00:00:00 2001 From: Johannes Mockenhaupt Date: Mon, 28 Aug 2017 12:24:01 +0200 Subject: [PATCH] Add temporary fix for edge case resulting in SetTbrCommand failing to set TBR_DURATION, where duration is not correctly pumped up to a multiple of 15. (cherry picked from commit df9952f) --- .../de/jotomo/ruffyscripter/commands/SetTbrCommand.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/de/jotomo/ruffyscripter/commands/SetTbrCommand.java b/app/src/main/java/de/jotomo/ruffyscripter/commands/SetTbrCommand.java index 2a040a968f..f51bce9259 100644 --- a/app/src/main/java/de/jotomo/ruffyscripter/commands/SetTbrCommand.java +++ b/app/src/main/java/de/jotomo/ruffyscripter/commands/SetTbrCommand.java @@ -180,8 +180,12 @@ public class SetTbrCommand extends BaseCommand { // Pressing up from 23:59 works to go to 24:00. scripter.verifyMenuIsDisplayed(MenuType.TBR_DURATION); scripter.pressUpKey(); - scripter.waitForMenuUpdate(); - currentDuration = scripter.readDisplayedDuration(); + // TODO optimization: replace with logic that calculates the amount of + // steps including this one and issues them in one go, with a final wait + do { + currentDuration = scripter.readDisplayedDuration(); + scripter.waitForMenuUpdate(); + } while (currentDuration % 15 != 0); } log.debug("Current TBR duration: " + currentDuration); long durationChange = duration - currentDuration;