Why don't you use Kodi for that?
https://forum.kodi.tv/
It can track your entire tv show, movie, and music library and keep track of play counts, last played and watch status, all played from within Kodi. You can then install the Trakt addon and sync trakt and Kodi with all that data also.
I don't know how much detail you need, but it is the way I track my media and playback history.
A little while ago I was also toying with an ebook library in Kodi. First trying to get Kodi to call Calibre, then trying to scrape the ebooks into Kodi. Had more success with the latter.