Prevent sleep

This commit is contained in:
tomkat83 2016-03-03 08:10:06 +01:00
parent 7bda97b255
commit c8004d3dbf
2 changed files with 6 additions and 1 deletions

View file

@ -361,6 +361,8 @@ class LibrarySync(Thread):
self.compare = manualrun or repair self.compare = manualrun or repair
xbmc.executebuiltin('InhibitIdleShutdown(true)') xbmc.executebuiltin('InhibitIdleShutdown(true)')
screensaver = utils.getScreensaver()
utils.setScreensaver(value="")
# Add sources # Add sources
utils.sourcesXML() utils.sourcesXML()
@ -373,6 +375,7 @@ class LibrarySync(Thread):
# Set views. Abort if unsuccessful # Set views. Abort if unsuccessful
if not self.maintainViews(): if not self.maintainViews():
xbmc.executebuiltin('InhibitIdleShutdown(false)') xbmc.executebuiltin('InhibitIdleShutdown(false)')
utils.setScreensaver(value=screensaver)
return False return False
process = { process = {
@ -385,6 +388,7 @@ class LibrarySync(Thread):
completed = process[itemtype]() completed = process[itemtype]()
if not completed: if not completed:
xbmc.executebuiltin('InhibitIdleShutdown(false)') xbmc.executebuiltin('InhibitIdleShutdown(false)')
utils.setScreensaver(value=screensaver)
return False return False
# Let kodi update the views in any case, since we're doing a full sync # Let kodi update the views in any case, since we're doing a full sync
@ -394,6 +398,7 @@ class LibrarySync(Thread):
utils.window('emby_initialScan', clear=True) utils.window('emby_initialScan', clear=True)
xbmc.executebuiltin('InhibitIdleShutdown(false)') xbmc.executebuiltin('InhibitIdleShutdown(false)')
utils.setScreensaver(value=screensaver)
return True return True
def processView(self, folderItem, kodi_db, emby_db, totalnodes): def processView(self, folderItem, kodi_db, emby_db, totalnodes):

View file

@ -349,7 +349,7 @@ class UserClient(threading.Thread):
dialog = xbmcgui.Dialog() dialog = xbmcgui.Dialog()
if username: if username:
dialog.notification(self.addonName, dialog.notification(self.addonName,
"Welcome %s" % username, "Welcome %s" % username.decode('utf-8'),
"special://home/addons/plugin.video." "special://home/addons/plugin.video."
"plexkodiconnect/icon.png") "plexkodiconnect/icon.png")
else: else: