Second attempt at fixing playcount situation

This should also reflect the actual Emby playcount. The websocket didn't
echo, but what I did is kill the echo caused by the video library update
after userdata change happens.
This commit is contained in:
angelblue05 2015-05-17 00:37:53 -05:00
parent 2aefab1545
commit ddb7ec4bbd
6 changed files with 33 additions and 33 deletions

View file

@ -32,6 +32,8 @@ class WebSocketThread(threading.Thread):
doUtils = DownloadUtils()
clientInfo = ClientInformation()
KodiMonitor = KodiMonitor.Kodi_Monitor()
WINDOW = xbmcgui.Window(10000)
addonName = clientInfo.getAddonName()
client = None
@ -101,13 +103,8 @@ class WebSocketThread(threading.Thread):
messageType = result.get("MessageType")
data = result.get("Data")
WINDOW = xbmcgui.Window( 10000 )
playedItemId = WINDOW.getProperty('played_itemId')
if (playedItemId != '') and (playedItemId in message):
# Prevent feedback for watched
WINDOW.clearProperty('played_itemId')
elif(messageType != None and messageType == "Play" and data != None):
if(messageType != None and messageType == "Play" and data != None):
itemIds = data.get("ItemIds")
playCommand = data.get("PlayCommand")
@ -289,6 +286,7 @@ class WebSocketThread(threading.Thread):
LibrarySync().IncrementalSync(itemsToUpdate)
def user_data_update(self, userDataList):
self.WINDOW.setProperty('prevent_libraryUpdate', "true")
itemsToUpdate = list()
for userData in userDataList:
itemId = userData.get("ItemId")