Is there a way to access the Plex database from an external process? Specifically, I want access to the watched/unwatched status of video items.
The media server’s HTTP API should be all that you need. I’m afraid there isn’t really any documentation for it yet, but you should be able to figure out what’s going on by watching the “Plex Media Server.log” file to see the requests being made while using one of the clients, and if you have any questions we’ll be happy to help out on the forum or in Plex Chat. The database itself is just a standard SQLite database, but we don’t really recommend modifying this manually as the format may change without notice, while the API is more likely to stay consistent.
First: If you break your stuff i am not responsible as the dev above said "don’t really recommend modifying this manually as the format may change without notice, while the API is more likely to stay consistent. "
On XP and Win server 2003: “C:\Documents and Settings\Administrator\Local Settings\Application Data\Plex Media Server\Plug-in Support\Databases\com.plexapp.plugins.library.db” is the database Plex uses download this tool: http://www.yunqa.de/delphi/doku.php/products/sqlitespy/index and open that file and you can see the information. Plex is built of XBMC and as such it uses SQLlite to store its backend (for now at least) if you are savvy enough you can do interact with the file directly.
there are some better GUI’s out there to interact with the file with but thats a small easy one. One thing i have yet to try is XBMC has a way you can make it use mysql for the database by setting up a file called advancesettings.xml (http://wiki.xbmc.org/index.php?title=Advancedsettings.xml) i LOVE the flexibility this provides and am hoping this will work for plex but i have not gotten to that part of my plex tinkering.
the table you want is “metadata_item_views” if the show or movie is listed in that table then its been watched, i think…
As for the API he meantioned:
http://192.168.1.5:32400/library/sections/7/unwatched will give me a XML view of all my TV shows that have unwatched episodes you can see more info on navigating the XML at http://wiki.plexapp.com/index.php/PlexNine_AdvancedInfo#Listing_an_Item_Details the XML API they have made is very nice and i would recommend you try doing what you need through this (if all you need to do is read) if you need to write then you will need knowledge of SQL.
Thanks, I got it already. The XML API was good enough. I used it write a small Vuze plugin that removes torrents of watched episodes a month after they have been watched.
I’ll be testing on my system for a few days and then, I’ll be looking for beta testers before I post to Vuze plugin repository.
Anyone interested?
I know I am late to the party but that is damn cool and innovative!
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.