mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-11-10 04:06:11 +00:00
on UserDataChanged call updatePlayCounts()
This commit is contained in:
parent
43a77bbba2
commit
7664e6e668
1 changed files with 8 additions and 3 deletions
|
@ -14,6 +14,7 @@ import websocket
|
|||
from ClientInformation import ClientInformation
|
||||
from DownloadUtils import DownloadUtils
|
||||
from PlaybackUtils import PlaybackUtils
|
||||
from LibrarySync import LibrarySync
|
||||
|
||||
_MODE_BASICPLAY=12
|
||||
|
||||
|
@ -126,11 +127,10 @@ class WebSocketThread(threading.Thread):
|
|||
self.logMsg("Stopping Client NO Object ERROR")
|
||||
|
||||
def on_message(self, ws, message):
|
||||
self.logMsg("Message : " + str(message))
|
||||
self.logMsg("Message : " + str(message), 0)
|
||||
result = json.loads(message)
|
||||
|
||||
messageType = result.get("MessageType")
|
||||
playCommand = result.get("PlayCommand")
|
||||
data = result.get("Data")
|
||||
|
||||
if(messageType != None and messageType == "Play" and data != None):
|
||||
|
@ -174,7 +174,12 @@ class WebSocketThread(threading.Thread):
|
|||
self.logMsg("Playback Seek : " + str(seekPositionTicks))
|
||||
seekTime = (seekPositionTicks / 1000) / 10000
|
||||
xbmc.Player().seekTime(seekTime)
|
||||
|
||||
|
||||
elif(messageType != None and messageType == "UserDataChanged"):
|
||||
# for now just do a full playcount sync
|
||||
self.logMsg("Message : Doing UserDataChanged calling updatePlayCounts()", 0)
|
||||
LibrarySync().updatePlayCounts()
|
||||
|
||||
|
||||
def on_error(self, ws, error):
|
||||
self.logMsg("Error : " + str(error))
|
||||
|
|
Loading…
Reference in a new issue