Where are internal statistics stored?
#1
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.
Reply
#2
its all in the DB
Reply
#3
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.
Reply
#4
most if not all can be retrieved with JSON-RPC
http://wiki.xbmc.org/?title=JSON-RPC_API
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#5
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
Reply
#6
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.
Reply
#7
(2014-08-21, 13:59)wsnipex Wrote: its all in the DB

was surprisingly most direct in helping me find the solution. I quickly found in my video database ("myvideos75" in my case, see an explanation of the video library if you're stumbling across this thread) a table called "tvshowview", in it having the following:

Code:
Column name: c00
Description: Title

Column name: Total Count
Description: # of episodes

Column name: Total Seasons
Description: ..you get it

Continuously impressed with how well these databases are structured. Makes it very easy to customize a pull of data.

Great source for understanding each table.
Reply
#8
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.
Reply
#9
(2014-08-21, 23:52)Milhouse Wrote: 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.

I suppose that's true, depending on what you're doing. In my case where i'll only be SELECTing data I can't see any potential harm caused, especially since my SQL connections are already established.
Reply

Logout Mark Read Team Forum Stats Members Help
Where are internal statistics stored?0