I’ve been playing with missing metadata detection. I think I have a decent working command which finds items in the database with missing metadata.
If you have sqlite3 installed, run this from your plex account.
sqlite3 ~/Library/Application\ Support/Plex\ Media\ Server/Plug-in\ Support/Databases/com.plexapp.plugins.library.db “SELECT C.file FROM metadata_items A LEFT JOIN media_items B ON A.id = B.metadata_item_id LEFT JOIN media_parts C ON B.id = C.media_item_id WHERE A.media_item_count > 0 AND (A.title_sort = ‘’ OR A.title = ‘’);”
If anyone has some feedback, I’d be happy to hear it
As @tom80H mentioned, to just display what’s unmatched I use the new unmatched filter in Plex Web.
But when I have, for what ever reason, multiple 100s of unmatched. I don’t need to see them, I want them deleted from the DB so plex can try and match them correctly on a new scan. So I use the following for that
cp com.plexapp.plugins.library.db com.plexapp.plugins.library.db.original
sqlite3 com.plexapp.plugins.library.db "DROP index 'index_title_sort_naturalsort'"
sqlite3 com.plexapp.plugins.library.db "DELETE from schema_migrations where version='20180501000000'"
sqlite3 com.plexapp.plugins.library.db "DELETE from metadata_items WHERE library_section_id = XXXX AND guid LIKE 'local%'"
Just set library_section_id to what ever Library you are working with
when I do a select count(*) from metadata_items statement with a WHERE clause of guid LIKE 'local%' the returned value matches that of unmatched in plex/web
Then this is inaccurate. Or maybe the definition of unmatched should be qualified. I just checked my library and I a few things with local%. Photos, which I excluded. I had several movies which weren’t in TMDB, but they’re showing up with proper info from the metadata I had to edit or load. (year, title, description, etc)
So I think there is more than just local%, but my query also misses out on stuff.
No. Having a guid starting with “local” means that the item wasn’t matched to an online source. It doesn’t mean there won’t be any metadata. If you add the metadata manually then the data is there, but it will still be considered unmatched. Photos and other videos will always be unmatched.
You can also have something that is matched, but missing metadata. This can happen if there is a glitch from the source, like TheTVDB. If their site is down so you can’t download the data, it may still get matched to have the proper GUID, but missing data.
If you are doing something to check that all videos have ALL their data, then you’ll actually have to check each data field. Even then, some data just might not exist from that source so you can’t tell if it’s missing or empty.
I understand. It’s why I think the local is one way to check, but won’t catch everything. And you’re right, checking ever field would be a significant query.
I may update mine to include summary, as well as title. And I have to set it to ignore my local video library, as well as photos. Luckily, I believe I got almost all that done.