From 6c1bd5cf478b9fc570ab8f279f4d782a139e9b56 Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Thu, 25 Jan 2018 05:16:01 -0600 Subject: [PATCH] Disable screensaver during the fast sync Allow sync to run if livetv is playing. --- resources/lib/librarysync.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/resources/lib/librarysync.py b/resources/lib/librarysync.py index 29943997..f5290c12 100644 --- a/resources/lib/librarysync.py +++ b/resources/lib/librarysync.py @@ -538,6 +538,10 @@ class LibrarySync(threading.Thread): with database.DatabaseConn('emby') as cursor_emby: with database.DatabaseConn('video') as cursor_video: + xbmc.executebuiltin('InhibitIdleShutdown(true)') + screensaver = utils.getScreensaver() + utils.setScreensaver(value="") + emby_db = embydb.Embydb_Functions(cursor_emby) incSyncIndicator = int(settings('incSyncIndicator') or 10) @@ -591,6 +595,9 @@ class LibrarySync(threading.Thread): if kodiupdate_video: self.forceLibraryUpdate = True + xbmc.executebuiltin('InhibitIdleShutdown(false)') + utils.setScreensaver(value=screensaver) + # if stuff happened then do some stuff if update_embydb: update_embydb = False @@ -744,7 +751,9 @@ class LibrarySync(threading.Thread): self.incremental_count = 0 window('emby_kodiScan', clear=True) - if not xbmc.Player().isPlaying() and window('emby_dbScan') != "true" and window('emby_shouldStop') != "true": + if ((not xbmc.Player().isPlaying() or xbmc.getCondVisibility('VideoPlayer.Content(livetv)')) and + window('emby_dbScan') != "true" and window('emby_shouldStop') != "true"): + self.incrementalSync() if window('emby_onWake') == "true" and window('emby_online') == "true":