I think that at some point a particular movie in my library was merged with another, such that the movie is sitting in the correct directory but doesn’t show up as the correct item in the library any more.
Short of deleting the file and waiting for Plex to scan and delete the associated metadata item, or manually running ‘Get info’ on every single metadata item, is there any way to find out which metadata item is now associated with the movie file in question?
For future reference, I also went digging in the Plex library SQLite database (com.plexapp.plugins.library.db) and put together the following query:
SELECT
media_items.id,
metadata_items.title,
media_parts.file,
metadata_items.media_item_count,
metadata_items.year
FROM media_items
INNER JOIN metadata_items ON (metadata_items.id = media_items.metadata_item_id)
INNER JOIN media_parts ON (media_parts.media_item_id = media_items.id)
WHERE metadata_items.library_section_id = 9
ORDER BY media_parts.file;
Anyone else running this query will need to change the library_section_id to the appropriate ID (see the library_sections table to get your own)