Mark movie as watched/unwatched

This commit is contained in:
tomkat83 2016-01-12 14:14:49 +01:00
parent ca731ba41e
commit b26b679dc1

View file

@ -13,6 +13,8 @@ import embydb_functions as embydb
import playbackutils as pbutils import playbackutils as pbutils
import utils import utils
from urllib import urlencode
################################################################################################# #################################################################################################
@ -150,12 +152,15 @@ class KodiMonitor(xbmc.Monitor):
utils.window('emby_skipWatched%s' % itemid, clear=True) utils.window('emby_skipWatched%s' % itemid, clear=True)
else: else:
# notify the server # notify the server
url = "{server}/emby/Users/{UserId}/PlayedItems/%s?format=json" % itemid args = {'key': itemid,
'identifier': 'com.plexapp.plugins.library'}
if playcount != 0: 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) self.logMsg("Mark as watched for itemid: %s" % itemid, 1)
else: 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) self.logMsg("Mark as unwatched for itemid: %s" % itemid, 1)
finally: finally:
embycursor.close() embycursor.close()