From 5696f76a5f7bcf9f17ae36085893d496aa35e32a Mon Sep 17 00:00:00 2001 From: Nick Date: Thu, 28 Apr 2016 19:05:33 +1000 Subject: [PATCH 1/2] added "fastsync" command to perform an incremental sync on demand --- default.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/default.py b/default.py index 94117d69..2a9ff290 100644 --- a/default.py +++ b/default.py @@ -102,7 +102,7 @@ class Main: # Other functions if mode == "settings": xbmc.executebuiltin('Addon.OpenSettings(plugin.video.emby)') - elif mode in ("manualsync", "repair"): + elif mode in ("manualsync", "fastsync", "repair"): if utils.window('emby_online') != "true": # Server is not online, do not run the sync xbmcgui.Dialog().ok(heading="Emby for Kodi", @@ -116,6 +116,8 @@ class Main: lib = librarysync.LibrarySync() if mode == "manualsync": librarysync.ManualSync().sync(dialog=True) + elif mode == "fastsync": + lib.startSync() else: lib.fullSync(repair=True) else: From a07f545d5a780d4816631ad71c4da49a9ab666d6 Mon Sep 17 00:00:00 2001 From: Nick Date: Fri, 29 Apr 2016 15:48:09 +1000 Subject: [PATCH 2/2] added option to perform sync when screensaver is deactivated --- resources/language/English/strings.xml | 1 + resources/lib/kodimonitor.py | 7 +++++++ resources/settings.xml | 1 + 3 files changed, 9 insertions(+) diff --git a/resources/language/English/strings.xml b/resources/language/English/strings.xml index 78a94417..3a8d7ba4 100644 --- a/resources/language/English/strings.xml +++ b/resources/language/English/strings.xml @@ -298,6 +298,7 @@ Duration of the music library pop up (in seconds) Server messages Generate a new device Id + Sync when screensaver is deactivated Welcome diff --git a/resources/lib/kodimonitor.py b/resources/lib/kodimonitor.py index f2b5ae86..74e32717 100644 --- a/resources/lib/kodimonitor.py +++ b/resources/lib/kodimonitor.py @@ -205,5 +205,12 @@ class KodiMonitor(xbmc.Monitor): xbmc.sleep(10000) utils.window('emby_onWake', value="true") + + elif method == "GUI.OnScreensaverDeactivated": + if utils.settings('dbSyncScreensaver') == "true": + xbmc.sleep(1000); + utils.window('emby_onWake', value="true") + + elif method == "Playlist.OnClear": pass \ No newline at end of file diff --git a/resources/settings.xml b/resources/settings.xml index d5d815dc..24458165 100644 --- a/resources/settings.xml +++ b/resources/settings.xml @@ -32,6 +32,7 @@ +