Always detect if user resumes playback

This commit is contained in:
croneter 2018-02-07 14:09:16 +01:00
parent 5ca0f7d6af
commit e744ff2b97

View file

@ -398,13 +398,10 @@ class SpecialMonitor(Thread):
""" """
def run(self): def run(self):
LOG.info("----====# Starting Special Monitor #====----") LOG.info("----====# Starting Special Monitor #====----")
player = Player()
# "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.thread_stopped(): while not self.thread_stopped():
is_playing = player.isPlaying() if (getCondVisibility('Window.IsVisible(DialogContextMenu.xml)') and
if (not is_playing and
getCondVisibility('Window.IsVisible(DialogContextMenu.xml)') and
getInfoLabel('Control.GetLabel(1002)') in strings): getInfoLabel('Control.GetLabel(1002)') in strings):
# Remember that the item IS indeed resumable # Remember that the item IS indeed resumable
state.RESUMABLE = True state.RESUMABLE = True
@ -417,5 +414,5 @@ class SpecialMonitor(Thread):
else: else:
# User chose something else from the context menu # User chose something else from the context menu
state.RESUME_PLAYBACK = False state.RESUME_PLAYBACK = False
sleep(100) sleep(200)
LOG.info("#====---- Special Monitor Stopped ----====#") LOG.info("#====---- Special Monitor Stopped ----====#")