Posts: 7
Joined: Nov 2013
Reputation:
0
It's convenient that XBMC/Kodi shows me via the interface how many movies/tvs I have and how many remain unwatched. Is this data stored anywhere or is it cached? I'm creating a small script that emails me statistics about my media.
Posts: 7
Joined: Nov 2013
Reputation:
0
Do the databases store the values raw, as "10 unwatched movies"? Or do the db's solely contain unwatched flags and totals the amount? Any examples would help.
Posts: 5,174
Joined: Jan 2010
Reputation:
97
Kib
Team-Kodi Member
Posts: 5,174
The software gets it from the database with an internal command that issues an SQL query.
From the outside you can require the data via the JSON-RPC api
Posts: 17,855
Joined: Jan 2011
Reputation:
1,055
Milhouse
Retired Team-Kodi Member
Posts: 17,855
The script in my sig will output stats with "./texturecache.py stats @logfile=tc.log" - look in the logfile for the JSON queries being executed to use in your own script, or just parse the output of texturecache.py.
Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
Posts: 17,855
Joined: Jan 2011
Reputation:
1,055
Milhouse
Retired Team-Kodi Member
Posts: 17,855
Bad idea accessing the database directly when you can do the same via JSON, at the very least it insulates you from schema changes (the latest video schema is v89) but also avoids any issues with SQLite or MySQL, and the JSON queries can be run against remote clients.
Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.