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