Fix resume

This commit is contained in:
angelblue05 2018-01-27 04:26:59 -06:00
parent c54ed32328
commit 16e5dbe479
2 changed files with 6 additions and 15 deletions

View file

@ -227,7 +227,6 @@ class SpecialMonitor(threading.Thread):
isPlaying = player.isPlaying() isPlaying = player.isPlaying()
if (not isPlaying and xbmc.getCondVisibility('Window.IsVisible(DialogContextMenu.xml)') and if (not isPlaying and xbmc.getCondVisibility('Window.IsVisible(DialogContextMenu.xml)') and
not xbmc.getCondVisibility('Window.IsVisible(MyVideoNav.xml)') and
xbmc.getInfoLabel('Control.GetLabel(1002)') == xbmc.getLocalizedString(12021)): xbmc.getInfoLabel('Control.GetLabel(1002)') == xbmc.getLocalizedString(12021)):
control = int(xbmcgui.Window(10106).getFocusId()) control = int(xbmcgui.Window(10106).getFocusId())

View file

@ -86,26 +86,18 @@ class PlaybackUtils(object):
force_play = False force_play = False
''' Krypton 17.6 broke StartOffset. Seems to be working in Leia. ''' Krypton 17.6 broke StartOffset. Seems to be working in Leia.
For now, set up using StartPercent. For now, set up using StartPercent and adjust a bit to compensate.
TODO: Once Leia is fully supported, move back to StartOffset. TODO: Once Leia is fully supported, move back to StartOffset.
''' '''
seektime_percent = (seektime/self.API.get_runtime()) * 100 if seektime:
seektime_percent = ((seektime/self.API.get_runtime()) * 100) - 0.40
log.info("seektime detected (percent): %s", seektime_percent) log.info("seektime detected (percent): %s", seektime_percent)
listitem.setProperty('StartPercent', str(seektime_percent)) listitem.setProperty('StartPercent', str(seektime_percent))
# Stack: [(url, listitem), (url, ...), ...] # Stack: [(url, listitem), (url, ...), ...]
self.stack[0][1].setPath(self.stack[0][0]) self.stack[0][1].setPath(self.stack[0][0])
try: try:
if not xbmc.getCondVisibility('Window.IsMedia'):
log.debug("Window.IsMedia detected.")
if self.item['Type'] == "Audio" and not xbmc.getCondVisibility('Integer.IsGreater(Playlist.Length(music),1)'):
log.debug("Music playlist length detected.")
if not xbmc.getCondVisibility('Integer.IsGreater(Playlist.Length(video),1)'):
log.debug("Video playlist length detected.")
if (not xbmc.getCondVisibility('Window.IsMedia') and if (not xbmc.getCondVisibility('Window.IsMedia') and
((self.item['Type'] == "Audio" and not xbmc.getCondVisibility('Integer.IsGreater(Playlist.Length(music),1)')) or ((self.item['Type'] == "Audio" and not xbmc.getCondVisibility('Integer.IsGreater(Playlist.Length(music),1)')) or
not xbmc.getCondVisibility('Integer.IsGreater(Playlist.Length(video),1)'))): not xbmc.getCondVisibility('Integer.IsGreater(Playlist.Length(video),1)'))):