Many of us want to report on items in the Plex database and I’ve spent years hacking the database for data I want to see, so sharing here for the benefit of others.
The queries were created using “DB Browser (SQLite)” and works connected to a live or static copy of the database. Note: Connecting to a live database requires reconnecting to see updates.
Updates
Added Library column
Added queries for Video and Audio file names
Improved query performance
Fixed issues with deleted files showing in queries
Packaged all queries in a single Zip file
Transcoding considerations
Use Handbrake to create transcoded copies that are smaller with lower bitrates and supported codecs, improving playback
Both MPEG-2 and VC-1 can be stored much more efficiently in H.264 (AVC) or H.265 (HEVC) with H.265 being most optimal
VC-1 Unsupported by most streaming devices, requiring transcoding which may fail to play and cause loss of detail in very bright scenes (i.e. explosions)
Copy and paste to Excel
Select the upper left corner of the query results and then Ctrl-C to copy the contents of the grid. Next, paste into an Excel spreadsheet. Note: Column headings are not copied.
Yes and no. I have a lot of “soft delete” items in my database for which the files no longer physically exist and that are no longer in trash, or at least Empty Trash does not clear them. Should this be considered a bug that I should report?
My thought is to use the “soft delete” flag to ignore and/or delete them from my queries.
Don’t forget that if the media is in a folder/drive that is not accessible, these don’t get removed incase the location becomes available again. Recreate the folder/drive, run a scan, and done.
Thanks. I tried recreating the directory structures earlier today and adding it to an existing library and a new one. Unfortunately, running a scan and then emptying trash did not remove the entries. I even tried adding one of the same files and one new one. All this did was add one more “ghost” entry for the new file.
Not sure what you did, but you should only need to create the folder that your library pointed to. I.e. your movie library is to point to C:\movies, but now you changed it to C:\my movies. You only need to recreate C:\movies and place 1 file in there, any file. As long as that base folder doesn’t appear empty, Plex will remove any associated entries.