From 3b3f9f7bba99d4c2aec6ef3a6e9538ac25a64020 Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Sat, 9 May 2015 01:44:02 -0500 Subject: [PATCH 1/3] First attempt at supporting split movies. --- resources/lib/PlaybackUtils.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/resources/lib/PlaybackUtils.py b/resources/lib/PlaybackUtils.py index 59aa8642..0d25fa71 100644 --- a/resources/lib/PlaybackUtils.py +++ b/resources/lib/PlaybackUtils.py @@ -48,6 +48,18 @@ class PlaybackUtils(): except: return + # For split movies + if u'PartCount' in result: + partcount = result[u'PartCount'] + # Get additional parts/playurl + url = "{server}/mediabrowser/Videos/%s/AdditionalParts" % id + parts = self.downloadUtils.downloadUrl(url) + partsId = [id] + for part in parts[u'Items']: + partId = part[u'Id'] + partsId.append(partId) + self.PLAYAllItems(partsId, startPositionTicks=None) + userData = result['UserData'] resume_result = 0 seekTime = 0 From 0ad7ed3c18435bf1273796ae6ec9780b4cc8ecdc Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Sat, 9 May 2015 02:17:58 -0500 Subject: [PATCH 2/3] Added support for webclient message Both "send message" and "send text" --- resources/lib/WebSocketClient.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/resources/lib/WebSocketClient.py b/resources/lib/WebSocketClient.py index 5ea9a3fb..e5065f14 100644 --- a/resources/lib/WebSocketClient.py +++ b/resources/lib/WebSocketClient.py @@ -179,6 +179,19 @@ class WebSocketThread(threading.Thread): self.remove_items(itemsRemoved) self.update_items(itemsToUpdate) + elif messageType == "GeneralCommand": + + if data.get("Name") == "DisplayMessage": + message = data.get("Arguments") + header = message[u'Header'] + text = message[u'Text'] + xbmcgui.Dialog().notification(header, text) + + elif data.get("Name") == "SendString": + message = data.get("Arguments") + string = message[u'String'] + xbmcgui.Dialog().notification("Emby server", string) + def remove_items(self, itemsRemoved): #Process video library From 7a1d4c255815e9c76fda023450a65b4f2f81a9f2 Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Sat, 9 May 2015 05:04:13 -0500 Subject: [PATCH 3/3] Fix for unicode path Seems os.path.exists needs utf-8 encoding or else it blows up. --- 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 b5f102cd..04f163e8 100644 --- a/resources/lib/PlayUtils.py +++ b/resources/lib/PlayUtils.py @@ -311,7 +311,7 @@ class PlayUtils(): path = result[u'Path'] # Verify the device has access to the direct path - if os.path.exists(path): + if os.path.exists(path.encode('utf-8')): return True elif ":\\" not in path: # Give benefit of the doubt for nfs protocol