From 6100faadda43e0b1adf6cabf35ed285390714595 Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Sun, 21 Feb 2016 17:43:46 -0600 Subject: [PATCH] Try to prevent sleep from happening During the initial sync or any major sync, manual or repair. --- resources/lib/itemtypes.py | 4 ++-- resources/lib/librarysync.py | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/resources/lib/itemtypes.py b/resources/lib/itemtypes.py index 98c9ac5e..05c80d7e 100644 --- a/resources/lib/itemtypes.py +++ b/resources/lib/itemtypes.py @@ -1304,8 +1304,8 @@ class TVShows(Items): airsBeforeSeason = item['AirsAfterSeasonNumber'] airsBeforeEpisode = 4096 # Kodi default number for afterseason ordering else: - airsBeforeSeason = item.get('AirsBeforeSeasonNumber', "-1") - airsBeforeEpisode = item.get('AirsBeforeEpisodeNumber', "-1") + airsBeforeSeason = item.get('AirsBeforeSeasonNumber') + airsBeforeEpisode = item.get('AirsBeforeEpisodeNumber') # Append multi episodes to title if item.get('IndexNumberEnd'): diff --git a/resources/lib/librarysync.py b/resources/lib/librarysync.py index 9af778c8..20d8ff17 100644 --- a/resources/lib/librarysync.py +++ b/resources/lib/librarysync.py @@ -228,6 +228,7 @@ class LibrarySync(threading.Thread): emby = self.emby music_enabled = utils.settings('enableMusic') == "true" + xbmc.executebuiltin('InhibitIdleShutdown(true)') window('emby_dbScan', value="true") # Add sources utils.sourcesXML() @@ -332,6 +333,7 @@ class LibrarySync(threading.Thread): xbmc.executebuiltin('UpdateLibrary(video)') elapsedtotal = datetime.now() - starttotal + xbmc.executebuiltin('InhibitIdleShutdown(false)') window('emby_dbScan', clear=True) window('emby_initialScan', clear=True) xbmcgui.Dialog().notification(