From 833e2b553f6c5790f35c8b1fdc265b9e6481c25e Mon Sep 17 00:00:00 2001 From: xnappo Date: Sat, 9 May 2015 07:26:33 -0500 Subject: [PATCH] Really remove all 'pending' code --- resources/lib/Player.py | 1 - resources/lib/WebSocketClient.py | 31 ++----------------------------- 2 files changed, 2 insertions(+), 30 deletions(-) diff --git a/resources/lib/Player.py b/resources/lib/Player.py index 9b26a533..b98eaa7c 100644 --- a/resources/lib/Player.py +++ b/resources/lib/Player.py @@ -61,7 +61,6 @@ class Player( xbmc.Player ): def stopAll(self): - self.ws.processPendingActions() if(len(self.played_information) == 0): return diff --git a/resources/lib/WebSocketClient.py b/resources/lib/WebSocketClient.py index e5065f14..a1c52d2a 100644 --- a/resources/lib/WebSocketClient.py +++ b/resources/lib/WebSocketClient.py @@ -22,9 +22,6 @@ from LibrarySync import LibrarySync from WriteKodiVideoDB import WriteKodiVideoDB from ReadEmbyDB import ReadEmbyDB -pendingUserDataList = [] -pendingItemsToRemove = [] -pendingItemsToUpdate = [] _MODE_BASICPLAY=12 class WebSocketThread(threading.Thread): @@ -96,9 +93,6 @@ class WebSocketThread(threading.Thread): self.logMsg("Stopping Client NO Object ERROR") def on_message(self, ws, message): - global pendingUserDataList - global pendingItemsToRemove - global pendingItemsToUpdate self.logMsg("Message : " + str(message), 0) result = json.loads(message) @@ -154,10 +148,7 @@ class WebSocketThread(threading.Thread): userDataList = data.get("UserDataList") self.logMsg("Message : Doing UserDataChanged : UserDataList : " + str(userDataList), 0) if(userDataList != None): - if xbmc.Player().isPlaying(): - pendingUserDataList += userDataList - else: - self.user_data_update(userDataList) + self.user_data_update(userDataList) elif(messageType != None and messageType == "LibraryChanged"): foldersAddedTo = data.get("FoldersAddedTo") @@ -172,10 +163,6 @@ class WebSocketThread(threading.Thread): self.logMsg("Message : WebSocket LibraryChanged : Items Updated : " + str(itemsUpdated), 0) self.logMsg("Message : WebSocket LibraryChanged : Items Removed : " + str(itemsRemoved), 0) - #if xbmc.Player().isPlaying(): - # pendingItemsToRemove += itemsRemoved - # pendingItemsToUpdate += itemsToUpdate - #else: self.remove_items(itemsRemoved) self.update_items(itemsToUpdate) @@ -287,18 +274,4 @@ class WebSocketThread(threading.Thread): break self.logMsg("Thread Exited") - - - def processPendingActions(self): - global pendingUserDataList - global pendingItemsToRemove - global pendingItemsToUpdate - if pendingUserDataList != []: - self.user_data_update(pendingUserDataList) - pendingUserDataList = [] - if pendingItemsToRemove != []: - self.remove_items(pendingItemsToRemove) - pendingItemsToRemove = [] - if pendingItemsToUpdate != []: - self.update_items(pendingItemsToUpdate) - pendingItemsToUpdate = [] \ No newline at end of file + \ No newline at end of file