Kodi Community Forum

Full Version: lastPlayed / Watched Status
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi there,

I'm looking for a sql database script to fix the "watched status":

Even that in the database xbmc_video99 the playCount is >1 my movies are of status unwatched in Kodi.

Thanks for help.
Oliver.
(2018-06-12, 09:07)OGeissler Wrote: [ -> ]xbmc_video99

Strange name for the database. Are you using MySQL setup or the standard SQLite database from install? The 99 indicates you are still on v16, is that correct?
Hi,

I'm sorry, database name was incorrect, correct is: xbmc_video107.
I'm on v17.6.

Oliver
Are you using MySQL shared setup or the standard SQLite database from install?
I'm sure his mysql setup dates back from the xbmc days, and probably updated every time since, still using the <name>xbmc_video</name> tag in the advancedsettings.xml file.

(2018-06-12, 09:07)OGeissler Wrote: [ -> ]I'm looking for a sql database script to fix the "watched status":
Even that in the database xbmc_video99 the playCount is >1 my movies are of status unwatched in Kodi.
The playCount and lastPlayed fields are stored in the 'files' database table, whereas the resume points are stored in the 'bookmarks' table.
Are you sure you are not using different databases at the moment?
Hi,

I'm using SQL Shared Setup with mysql db.

Oliver
(2018-06-12, 11:31)Klojum Wrote: [ -> ]Are you sure you are not using different databases at the moment?
Double-check which databases are on your server, and get rid of the older ones.
Do you have more than one video database with the 107 version extension?
And are all your clients on the same version of Kodi?
Hi,

I've just one Windows Client which accesses the DB.
Can you explain, how "Watched" status is calculated or can be modified?
As I can see, movies in the database with PlayCount>1 do still have UnWatched status.

I want to change that programmatically.
Oliver
(2018-06-12, 22:22)OGeissler Wrote: [ -> ]As I can see, movies in the database with PlayCount>1 do still have UnWatched status.
I think that would be > 0, or >= 1 . If you have watched a video once, it already has a watched status.

(2018-06-12, 22:22)OGeissler Wrote: [ -> ]Can you explain, how "Watched" status is calculated or can be modified?
The calculation has already been explained, modifying can be done by executing SQL queries onto the MySQL database.
You'll have to find the correct file-id for your movie/episode/musicvideo/whatever.
sql:

UPDATE
files
SET
playCount IS NULL,
lastPlayed IS NULL
WHERE
idFile = <idnumber>

If you want to reset all the watched statuses, just leave out the WHERE idFile = <idnumber> part.
Hi,

thanks for the info.
I've found out, that playCount and lastPlayed in xmbc_video99 differs from xmbc_video107.
How can I copy them over from one db to another?

Thanks a lot for an info.
Oliver
(2018-06-17, 15:00)OGeissler Wrote: [ -> ]How can I copy them over from one db to another?
Confused ...

It's a database, it's not a simple text file or excel sheet.
"Simply" copying over database values is only done by executing SQL queries.

The best thing would be if the v99 database would be up-to-date as well (using a previous Kodi version), so it can easily upgraded by Kodi itself.
Alternatively, you could update things by hand, which you may end up doing as file id's may in both databases.