mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-24 17:56:11 +00:00
added playcount to the sync
This commit is contained in:
parent
fc2f158ad0
commit
6e9983edba
1 changed files with 7 additions and 2 deletions
|
@ -112,7 +112,7 @@ class WriteKodiDB():
|
||||||
else:
|
else:
|
||||||
dateadded = None
|
dateadded = None
|
||||||
|
|
||||||
playcount = None
|
playcount = 0
|
||||||
if userData.get("PlayCount") == "1":
|
if userData.get("PlayCount") == "1":
|
||||||
playcount = 1
|
playcount = 1
|
||||||
|
|
||||||
|
@ -144,7 +144,9 @@ class WriteKodiDB():
|
||||||
fileid = fileid + 1
|
fileid = fileid + 1
|
||||||
pathsql="insert into files(idFile, idPath, strFilename, playCount, lastPlayed, dateAdded) values(?, ?, ?, ?, ?, ?)"
|
pathsql="insert into files(idFile, idPath, strFilename, playCount, lastPlayed, dateAdded) values(?, ?, ?, ?, ?, ?)"
|
||||||
cursor.execute(pathsql, (fileid,pathid,filename,playcount,userData.get("LastPlayedDate"),dateadded))
|
cursor.execute(pathsql, (fileid,pathid,filename,playcount,userData.get("LastPlayedDate"),dateadded))
|
||||||
|
else:
|
||||||
|
pathsql="update files SET playCount = ?, lastPlayed = ? WHERE idFile = ?"
|
||||||
|
cursor.execute(pathsql, (playcount,userData.get("LastPlayedDate"), fileid))
|
||||||
|
|
||||||
##### ADD THE MOVIE ############
|
##### ADD THE MOVIE ############
|
||||||
if movieid == None:
|
if movieid == None:
|
||||||
|
@ -487,6 +489,9 @@ class WriteKodiDB():
|
||||||
fileid = fileid + 1
|
fileid = fileid + 1
|
||||||
sql="INSERT OR REPLACE into files(idFile, idPath, strFilename, playCount, lastPlayed, dateAdded) values(?, ?, ?, ?, ?, ?)"
|
sql="INSERT OR REPLACE into files(idFile, idPath, strFilename, playCount, lastPlayed, dateAdded) values(?, ?, ?, ?, ?, ?)"
|
||||||
cursor.execute(sql, (fileid,pathid,filename,playcount,lastplayed,dateadded))
|
cursor.execute(sql, (fileid,pathid,filename,playcount,lastplayed,dateadded))
|
||||||
|
else:
|
||||||
|
pathsql="update files SET playCount = ?, lastPlayed = ? WHERE idFile = ?"
|
||||||
|
cursor.execute(pathsql, (playcount,userData.get("LastPlayedDate"), fileid))
|
||||||
|
|
||||||
# safety check: check season first
|
# safety check: check season first
|
||||||
season = 0
|
season = 0
|
||||||
|
|
Loading…
Reference in a new issue