mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-25 02:06:09 +00:00
Really remove all 'pending' code
This commit is contained in:
parent
eb636def38
commit
833e2b553f
2 changed files with 2 additions and 30 deletions
|
@ -61,7 +61,6 @@ class Player( xbmc.Player ):
|
||||||
|
|
||||||
def stopAll(self):
|
def stopAll(self):
|
||||||
|
|
||||||
self.ws.processPendingActions()
|
|
||||||
if(len(self.played_information) == 0):
|
if(len(self.played_information) == 0):
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
|
@ -22,9 +22,6 @@ from LibrarySync import LibrarySync
|
||||||
from WriteKodiVideoDB import WriteKodiVideoDB
|
from WriteKodiVideoDB import WriteKodiVideoDB
|
||||||
from ReadEmbyDB import ReadEmbyDB
|
from ReadEmbyDB import ReadEmbyDB
|
||||||
|
|
||||||
pendingUserDataList = []
|
|
||||||
pendingItemsToRemove = []
|
|
||||||
pendingItemsToUpdate = []
|
|
||||||
_MODE_BASICPLAY=12
|
_MODE_BASICPLAY=12
|
||||||
|
|
||||||
class WebSocketThread(threading.Thread):
|
class WebSocketThread(threading.Thread):
|
||||||
|
@ -96,9 +93,6 @@ class WebSocketThread(threading.Thread):
|
||||||
self.logMsg("Stopping Client NO Object ERROR")
|
self.logMsg("Stopping Client NO Object ERROR")
|
||||||
|
|
||||||
def on_message(self, ws, message):
|
def on_message(self, ws, message):
|
||||||
global pendingUserDataList
|
|
||||||
global pendingItemsToRemove
|
|
||||||
global pendingItemsToUpdate
|
|
||||||
self.logMsg("Message : " + str(message), 0)
|
self.logMsg("Message : " + str(message), 0)
|
||||||
result = json.loads(message)
|
result = json.loads(message)
|
||||||
|
|
||||||
|
@ -154,10 +148,7 @@ class WebSocketThread(threading.Thread):
|
||||||
userDataList = data.get("UserDataList")
|
userDataList = data.get("UserDataList")
|
||||||
self.logMsg("Message : Doing UserDataChanged : UserDataList : " + str(userDataList), 0)
|
self.logMsg("Message : Doing UserDataChanged : UserDataList : " + str(userDataList), 0)
|
||||||
if(userDataList != None):
|
if(userDataList != None):
|
||||||
if xbmc.Player().isPlaying():
|
self.user_data_update(userDataList)
|
||||||
pendingUserDataList += userDataList
|
|
||||||
else:
|
|
||||||
self.user_data_update(userDataList)
|
|
||||||
|
|
||||||
elif(messageType != None and messageType == "LibraryChanged"):
|
elif(messageType != None and messageType == "LibraryChanged"):
|
||||||
foldersAddedTo = data.get("FoldersAddedTo")
|
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 Updated : " + str(itemsUpdated), 0)
|
||||||
self.logMsg("Message : WebSocket LibraryChanged : Items Removed : " + str(itemsRemoved), 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.remove_items(itemsRemoved)
|
||||||
self.update_items(itemsToUpdate)
|
self.update_items(itemsToUpdate)
|
||||||
|
|
||||||
|
@ -288,17 +275,3 @@ class WebSocketThread(threading.Thread):
|
||||||
|
|
||||||
self.logMsg("Thread Exited")
|
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 = []
|
|
Loading…
Reference in a new issue