Fix playback resuming potentially too often

This commit is contained in:
Croneter 2018-03-20 11:48:17 +01:00
parent 524466360f
commit d8555ee0cc

View file

@ -412,8 +412,8 @@ class SpecialMonitor(Thread):
# "Start from beginning", "Play from beginning"
strings = (getLocalizedString(12021), getLocalizedString(12023))
while not self.stopped():
if (getCondVisibility('Window.IsVisible(DialogContextMenu.xml)') and
getInfoLabel('Control.GetLabel(1002)') in strings):
if getCondVisibility('Window.IsVisible(DialogContextMenu.xml)'):
if getInfoLabel('Control.GetLabel(1002)') in strings:
# Remember that the item IS indeed resumable
control = int(Window(10106).getFocusId())
if control == 1002:
@ -424,5 +424,8 @@ class SpecialMonitor(Thread):
else:
# User chose something else from the context menu
state.RESUME_PLAYBACK = False
else:
# Different context menu is displayed
state.RESUME_PLAYBACK = False
sleep(200)
LOG.info("#====---- Special Monitor Stopped ----====#")