Switch order for watched

I have been testing for the past two days. it seems to work better this
way.  That is until marcelveldt has time to go over this :) Thanks, and
I'm off!
This commit is contained in:
angelblue05 2015-05-24 00:56:31 -05:00
parent 9197e274d2
commit ced36a8de5

View file

@ -39,13 +39,6 @@ class WriteKodiVideoDB():
cursor.close cursor.close
if(emby_id != None): if(emby_id != None):
addon = xbmcaddon.Addon(id='plugin.video.emby')
downloadUtils = DownloadUtils()
watchedurl = "{server}/mediabrowser/Users/{UserId}/PlayedItems/%s" % emby_id
if playcount != 0:
downloadUtils.downloadUrl(watchedurl, type="POST")
else:
downloadUtils.downloadUrl(watchedurl, type="DELETE")
# Erase resume point when user marks watched/unwatched to follow Emby behavior # Erase resume point when user marks watched/unwatched to follow Emby behavior
# Also force sets the playcount to instantly reflect the appropriate playstate. # Also force sets the playcount to instantly reflect the appropriate playstate.
if type == "episode": if type == "episode":
@ -53,6 +46,14 @@ class WriteKodiVideoDB():
elif type == "movie": elif type == "movie":
resume = '{"jsonrpc": "2.0", "method": "VideoLibrary.SetMovieDetails", "params": {"movieid": %d, "playcount": %d, "resume": {"position": 0}}, "id": "setResumePoint"}' % (id, playcount) resume = '{"jsonrpc": "2.0", "method": "VideoLibrary.SetMovieDetails", "params": {"movieid": %d, "playcount": %d, "resume": {"position": 0}}, "id": "setResumePoint"}' % (id, playcount)
xbmc.executeJSONRPC(resume) xbmc.executeJSONRPC(resume)
addon = xbmcaddon.Addon(id='plugin.video.emby')
downloadUtils = DownloadUtils()
watchedurl = "{server}/mediabrowser/Users/{UserId}/PlayedItems/%s" % emby_id
if playcount != 0:
downloadUtils.downloadUrl(watchedurl, type="POST")
else:
downloadUtils.downloadUrl(watchedurl, type="DELETE")
def addOrUpdateMovieToKodiLibrary( self, embyId ,connection, cursor, viewTag): def addOrUpdateMovieToKodiLibrary( self, embyId ,connection, cursor, viewTag):