Add sync on wakeup

This commit is contained in:
xnappo 2015-05-03 10:05:26 -05:00
parent 76691ea687
commit 7a2d0d2ef7

View file

@ -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)