fix for playcount sync

This commit is contained in:
Marcel van der Veldt 2015-07-29 02:51:57 +02:00
parent 2968638220
commit 619ea2d876

View file

@ -67,7 +67,7 @@ class WriteKodiVideoDB():
doUtils.downloadUrl(watchedurl, type = "DELETE") doUtils.downloadUrl(watchedurl, type = "DELETE")
self.logMsg("Mark as unwatched for Id: %s, playcount: %s." % (emby_id, playcount), 1) self.logMsg("Mark as unwatched for Id: %s, playcount: %s." % (emby_id, playcount), 1)
# Erase any resume point associated # Erase any resume point associated
self.setKodiResumePoint(id, 0, 0, cursor) self.setKodiResumePoint(id, 0, 0, cursor, playcount)
finally: finally:
cursor.close cursor.close
@ -825,7 +825,7 @@ class WriteKodiVideoDB():
if cacheimage and imageType in ("fanart", "poster"): if cacheimage and imageType in ("fanart", "poster"):
self.textureCache.CacheTexture(imageUrl) self.textureCache.CacheTexture(imageUrl)
def setKodiResumePoint(self, fileid, resume_seconds, total_seconds, cursor, playcount=None, dateplayed=None, realpath=None, realfile=None): def setKodiResumePoint(self, fileid, resume_seconds, total_seconds, cursor, playcount, dateplayed=None, realpath=None, realfile=None):
if realpath: if realpath:
#delete any existing resume point for the real filepath #delete any existing resume point for the real filepath
@ -842,9 +842,8 @@ class WriteKodiVideoDB():
cursor.execute("DELETE FROM bookmark WHERE idFile = ?", (fileid,)) cursor.execute("DELETE FROM bookmark WHERE idFile = ?", (fileid,))
#set watched count #set watched count
if playcount: query = "UPDATE files SET playCount = ?, lastPlayed = ? WHERE idFile = ?"
query = "UPDATE files SET playCount = ?, lastPlayed = ? WHERE idFile = ?" cursor.execute(query, (playcount, dateplayed, fileid))
cursor.execute(query, (playcount, dateplayed, fileid))
#set the resume bookmark #set the resume bookmark
if resume_seconds: if resume_seconds: