From 7a2d0d2ef78afd2178da40b14ab1fff9a88a11df Mon Sep 17 00:00:00 2001 From: xnappo Date: Sun, 3 May 2015 10:05:26 -0500 Subject: [PATCH] Add sync on wakeup --- resources/lib/KodiMonitor.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/resources/lib/KodiMonitor.py b/resources/lib/KodiMonitor.py index 42208475..a3be00a5 100644 --- a/resources/lib/KodiMonitor.py +++ b/resources/lib/KodiMonitor.py @@ -11,6 +11,7 @@ import json import Utils as utils from WriteKodiDB import WriteKodiDB from ReadKodiDB import ReadKodiDB +from LibrarySync import LibrarySync from PlayUtils import PlayUtils from DownloadUtils import DownloadUtils from PlaybackUtils import PlaybackUtils @@ -45,6 +46,11 @@ class Kodi_Monitor(xbmc.Monitor): utils.logMsg("MB# Sync","Kodi_Monitor--> VideoLibrary.OnUpdate : " + str(data),2) WriteKodiDB().updatePlayCountFromKodi(item, type, playcount) - + if method == "System.OnWake": + xbmc.sleep(10000) #Allow network to wake up + utils.logMsg("Doing_Db_Sync Post Resume: syncDatabase (Started)",1) + utils.logMsg("Doing_Db_Sync Post Resume: syncDatabase (Finished) " + str(libSync),1) + +