Fix screensaver toggle

This commit is contained in:
angelblue05 2018-10-03 19:05:16 -05:00
parent f1068667b4
commit a5ffd8871b

View file

@ -183,7 +183,7 @@ class Library(threading.Thread):
self.pending_refresh = True self.pending_refresh = True
if self.pending_refresh: if self.pending_refresh:
if not settings('dbSyncScreensaver.bool'): if not settings('dbSyncScreensaver.bool') and self.screensaver is None:
xbmc.executebuiltin('InhibitIdleShutdown(true)') xbmc.executebuiltin('InhibitIdleShutdown(true)')
self.screensaver = get_screensaver() self.screensaver = get_screensaver()
@ -194,10 +194,11 @@ class Library(threading.Thread):
self.pending_refresh = False self.pending_refresh = False
self.save_last_sync() self.save_last_sync()
if not settings('dbSyncScreensaver.bool'): if not settings('dbSyncScreensaver.bool') and self.screensaver is not None:
xbmc.executebuiltin('InhibitIdleShutdown(false)') xbmc.executebuiltin('InhibitIdleShutdown(false)')
set_screensaver(value=self.screensaver) set_screensaver(value=self.screensaver)
self.screensaver = None
if xbmc.getCondVisibility('Container.Content(musicvideos)') or xbmc.getCondVisibility('Window.IsMedia'): # Prevent cursor from moving if xbmc.getCondVisibility('Container.Content(musicvideos)') or xbmc.getCondVisibility('Window.IsMedia'): # Prevent cursor from moving
xbmc.executebuiltin('Container.Refresh') xbmc.executebuiltin('Container.Refresh')