From b26b679dc19edc062590c6fd7285f2abda690b94 Mon Sep 17 00:00:00 2001 From: tomkat83 Date: Tue, 12 Jan 2016 14:14:49 +0100 Subject: [PATCH] Mark movie as watched/unwatched --- resources/lib/kodimonitor.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/resources/lib/kodimonitor.py b/resources/lib/kodimonitor.py index 80e664f6..ff1a5e6d 100644 --- a/resources/lib/kodimonitor.py +++ b/resources/lib/kodimonitor.py @@ -13,6 +13,8 @@ import embydb_functions as embydb import playbackutils as pbutils import utils +from urllib import urlencode + ################################################################################################# @@ -150,12 +152,15 @@ class KodiMonitor(xbmc.Monitor): utils.window('emby_skipWatched%s' % itemid, clear=True) else: # notify the server - url = "{server}/emby/Users/{UserId}/PlayedItems/%s?format=json" % itemid + args = {'key': itemid, + 'identifier': 'com.plexapp.plugins.library'} if playcount != 0: - doUtils.downloadUrl(url, type="POST") + url = "{server}/:/scrobble?" + urlencode(args) + doUtils.downloadUrl(url, type="GET") self.logMsg("Mark as watched for itemid: %s" % itemid, 1) else: - doUtils.downloadUrl(url, type="DELETE") + url = "{server}/:/unscrobble?" + urlencode(args) + doUtils.downloadUrl(url, type="GET") self.logMsg("Mark as unwatched for itemid: %s" % itemid, 1) finally: embycursor.close()