mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-25 10:16:11 +00:00
fix for playcount sync
This commit is contained in:
parent
2968638220
commit
619ea2d876
1 changed files with 4 additions and 5 deletions
|
@ -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:
|
||||||
|
|
Loading…
Reference in a new issue