From 5696f76a5f7bcf9f17ae36085893d496aa35e32a Mon Sep 17 00:00:00 2001 From: Nick Date: Thu, 28 Apr 2016 19:05:33 +1000 Subject: [PATCH 01/12] 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 02/12] 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 @@ + From 06c85ccc699d4f7b825406ba68e1c9900d315414 Mon Sep 17 00:00:00 2001 From: A69Tor Date: Fri, 6 May 2016 16:04:39 -0400 Subject: [PATCH 03/12] Update strings.xml Add Force Transcode Hi10P --- resources/language/English/strings.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/language/English/strings.xml b/resources/language/English/strings.xml index 3a8d7ba4..1a145adc 100644 --- a/resources/language/English/strings.xml +++ b/resources/language/English/strings.xml @@ -299,6 +299,7 @@ Server messages Generate a new device Id Sync when screensaver is deactivated + Force Transcode Hi10P Welcome From 27f877164228f331e351f64df10a36b782bc5d1f Mon Sep 17 00:00:00 2001 From: A69Tor Date: Fri, 6 May 2016 16:05:17 -0400 Subject: [PATCH 04/12] Update settings.xml Add Force Transcode Hi10P setting --- resources/settings.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/settings.xml b/resources/settings.xml index 24458165..6deb4810 100644 --- a/resources/settings.xml +++ b/resources/settings.xml @@ -55,6 +55,7 @@ + From 6cb056c987eb9ec86e30bea615dbbb4683385409 Mon Sep 17 00:00:00 2001 From: A69Tor Date: Fri, 6 May 2016 16:24:23 -0400 Subject: [PATCH 05/12] Update playutils.py Add in videoprofile check and force transcode for Hi10P --- resources/lib/playutils.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/resources/lib/playutils.py b/resources/lib/playutils.py index 622781d2..7f5b6926 100644 --- a/resources/lib/playutils.py +++ b/resources/lib/playutils.py @@ -102,7 +102,12 @@ class PlayUtils(): videotrack = self.item['MediaSources'][0]['Name'] transcodeH265 = settings('transcodeH265') + videoprofile = self.item['MediaSources'][1]['Name'] + transcodeHi10P = settings('transcodeHi10P') + if transcodeHi10P == "true" and "H264" in videotrack and "High 10" in videoprofile: + return False + if transcodeH265 in ("1", "2", "3") and ("HEVC" in videotrack or "H265" in videotrack): # Avoid H265/HEVC depending on the resolution resolution = int(videotrack.split("P", 1)[0]) @@ -207,6 +212,11 @@ class PlayUtils(): videotrack = self.item['MediaSources'][0]['Name'] transcodeH265 = utils.settings('transcodeH265') + videoprofile = self.item['MediaSources'][1]['Name'] + transcodeHi10P = settings('transcodeHi10P') + + if transcodeHi10P == "true" and "H264" in videotrack and "High 10" in videoprofile: + return False if transcodeH265 in ("1", "2", "3") and ("HEVC" in videotrack or "H265" in videotrack): # Avoid H265/HEVC depending on the resolution @@ -423,4 +433,4 @@ class PlayUtils(): else: playurlprefs += "&AudioBitrate=192000" - return playurlprefs \ No newline at end of file + return playurlprefs From d99e7a12906b5e014a2798178c44bb84f3bea6be Mon Sep 17 00:00:00 2001 From: A69Tor Date: Fri, 6 May 2016 16:41:37 -0400 Subject: [PATCH 06/12] Update playutils.py --- resources/lib/playutils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/lib/playutils.py b/resources/lib/playutils.py index 7f5b6926..4cf65f16 100644 --- a/resources/lib/playutils.py +++ b/resources/lib/playutils.py @@ -102,7 +102,7 @@ class PlayUtils(): videotrack = self.item['MediaSources'][0]['Name'] transcodeH265 = settings('transcodeH265') - videoprofile = self.item['MediaSources'][1]['Name'] + videoprofile = self.item['MediaSources'][0]['Profile'] transcodeHi10P = settings('transcodeHi10P') if transcodeHi10P == "true" and "H264" in videotrack and "High 10" in videoprofile: @@ -212,7 +212,7 @@ class PlayUtils(): videotrack = self.item['MediaSources'][0]['Name'] transcodeH265 = utils.settings('transcodeH265') - videoprofile = self.item['MediaSources'][1]['Name'] + videoprofile = self.item['MediaSources'][0]['Profile'] transcodeHi10P = settings('transcodeHi10P') if transcodeHi10P == "true" and "H264" in videotrack and "High 10" in videoprofile: From 7bf0912a111f86908e1c8671b0b0076024ddc642 Mon Sep 17 00:00:00 2001 From: A69Tor Date: Fri, 6 May 2016 16:46:30 -0400 Subject: [PATCH 07/12] Update playutils.py debug --- resources/lib/playutils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lib/playutils.py b/resources/lib/playutils.py index 4cf65f16..da3ff008 100644 --- a/resources/lib/playutils.py +++ b/resources/lib/playutils.py @@ -18,7 +18,7 @@ class PlayUtils(): def __init__(self, item): self.item = item - + self.logMsg(self.item) self.clientInfo = clientinfo.ClientInfo() self.addonName = self.clientInfo.getAddonName() From db8ddc16d2c278d59e64bbb28c8cbe14911114f1 Mon Sep 17 00:00:00 2001 From: A69Tor Date: Fri, 6 May 2016 18:00:52 -0400 Subject: [PATCH 08/12] Update settings.xml Correct Bool for Transcode Hi10P --- resources/settings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/settings.xml b/resources/settings.xml index 6deb4810..77d57a33 100644 --- a/resources/settings.xml +++ b/resources/settings.xml @@ -55,7 +55,7 @@ - + From 9d50c4f74526e6afeeb7dbc7589eb1cfc1a66e69 Mon Sep 17 00:00:00 2001 From: A69Tor Date: Fri, 6 May 2016 18:55:14 -0400 Subject: [PATCH 09/12] Update playutils.py Modified Hi10P to get streams and parse profiles --- resources/lib/playutils.py | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/resources/lib/playutils.py b/resources/lib/playutils.py index da3ff008..a6eff5ea 100644 --- a/resources/lib/playutils.py +++ b/resources/lib/playutils.py @@ -102,11 +102,15 @@ class PlayUtils(): videotrack = self.item['MediaSources'][0]['Name'] transcodeH265 = settings('transcodeH265') - videoprofile = self.item['MediaSources'][0]['Profile'] - transcodeHi10P = settings('transcodeHi10P') - - if transcodeHi10P == "true" and "H264" in videotrack and "High 10" in videoprofile: - return False + videoprofiles = self.item['MediaSources'][0]['MediaStreams'] + streamprofiles = [] + for vprofile in videoprofiles: + if "Profile" in vprofile: + streamprofiles.append(vprofile['Profile']) + transcodeHi10P = utils.settings('transcodeHi10P') + + if transcodeHi10P == "true" and "H264" in videotrack and "High 10" in streamprofiles: + return False if transcodeH265 in ("1", "2", "3") and ("HEVC" in videotrack or "H265" in videotrack): # Avoid H265/HEVC depending on the resolution @@ -212,11 +216,15 @@ class PlayUtils(): videotrack = self.item['MediaSources'][0]['Name'] transcodeH265 = utils.settings('transcodeH265') - videoprofile = self.item['MediaSources'][0]['Profile'] - transcodeHi10P = settings('transcodeHi10P') - - if transcodeHi10P == "true" and "H264" in videotrack and "High 10" in videoprofile: - return False + videoprofiles = self.item['MediaSources'][0]['MediaStreams'] + streamprofiles = [] + for vprofile in videoprofiles: + if "Profile" in vprofile: + streamprofiles.append(vprofile['Profile']) + transcodeHi10P = utils.settings('transcodeHi10P') + + if transcodeHi10P == "true" and "H264" in videotrack and "High 10" in streamprofiles: + return False if transcodeH265 in ("1", "2", "3") and ("HEVC" in videotrack or "H265" in videotrack): # Avoid H265/HEVC depending on the resolution From 055366753a16d97f32bc4b1c96c50948c41b305c Mon Sep 17 00:00:00 2001 From: A69Tor Date: Fri, 6 May 2016 18:57:19 -0400 Subject: [PATCH 10/12] Update playutils.py Remove debug log line --- resources/lib/playutils.py | 1 - 1 file changed, 1 deletion(-) diff --git a/resources/lib/playutils.py b/resources/lib/playutils.py index a6eff5ea..f8db1710 100644 --- a/resources/lib/playutils.py +++ b/resources/lib/playutils.py @@ -18,7 +18,6 @@ class PlayUtils(): def __init__(self, item): self.item = item - self.logMsg(self.item) self.clientInfo = clientinfo.ClientInfo() self.addonName = self.clientInfo.getAddonName() From 04377c5a9cf9b44a5c2325f94e69f9d4e3882a10 Mon Sep 17 00:00:00 2001 From: A69Tor Date: Fri, 6 May 2016 19:16:07 -0400 Subject: [PATCH 11/12] Update playutils.py Condense videoprofiles check --- resources/lib/playutils.py | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/resources/lib/playutils.py b/resources/lib/playutils.py index f8db1710..a1de2948 100644 --- a/resources/lib/playutils.py +++ b/resources/lib/playutils.py @@ -101,16 +101,12 @@ class PlayUtils(): videotrack = self.item['MediaSources'][0]['Name'] transcodeH265 = settings('transcodeH265') - videoprofiles = self.item['MediaSources'][0]['MediaStreams'] - streamprofiles = [] - for vprofile in videoprofiles: - if "Profile" in vprofile: - streamprofiles.append(vprofile['Profile']) + videoprofiles = [x['Profile'] for x in self.item['MediaSources'][0]['MediaStreams'] if 'Profile' in x] transcodeHi10P = utils.settings('transcodeHi10P') - - if transcodeHi10P == "true" and "H264" in videotrack and "High 10" in streamprofiles: + + if transcodeHi10P == "true" and "H264" in videotrack and "High 10" in videoprofiles: return False - + if transcodeH265 in ("1", "2", "3") and ("HEVC" in videotrack or "H265" in videotrack): # Avoid H265/HEVC depending on the resolution resolution = int(videotrack.split("P", 1)[0]) @@ -215,14 +211,10 @@ class PlayUtils(): videotrack = self.item['MediaSources'][0]['Name'] transcodeH265 = utils.settings('transcodeH265') - videoprofiles = self.item['MediaSources'][0]['MediaStreams'] - streamprofiles = [] - for vprofile in videoprofiles: - if "Profile" in vprofile: - streamprofiles.append(vprofile['Profile']) + videoprofiles = [x['Profile'] for x in self.item['MediaSources'][0]['MediaStreams'] if 'Profile' in x] transcodeHi10P = utils.settings('transcodeHi10P') - - if transcodeHi10P == "true" and "H264" in videotrack and "High 10" in streamprofiles: + + if transcodeHi10P == "true" and "H264" in videotrack and "High 10" in videoprofiles: return False if transcodeH265 in ("1", "2", "3") and ("HEVC" in videotrack or "H265" in videotrack): From ffb2b11d7c2efdca6e1214ec060bbc926b7d4ce7 Mon Sep 17 00:00:00 2001 From: Nick Date: Wed, 11 May 2016 15:35:35 +1000 Subject: [PATCH 12/12] screensaver sync delay increased to 5 seconds --- resources/lib/kodimonitor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lib/kodimonitor.py b/resources/lib/kodimonitor.py index 74e32717..ea1a4f17 100644 --- a/resources/lib/kodimonitor.py +++ b/resources/lib/kodimonitor.py @@ -208,7 +208,7 @@ class KodiMonitor(xbmc.Monitor): elif method == "GUI.OnScreensaverDeactivated": if utils.settings('dbSyncScreensaver') == "true": - xbmc.sleep(1000); + xbmc.sleep(5000); utils.window('emby_onWake', value="true")