I am using the new plex scanner and library, not the legacy.
Is there a way for me to query the plex database to find which IMDB title it has matched a movie to? I do specify IMDB in .nfo files. I would like to be able to see what Plex used instead.
I tried this, but not really seeing any data that looks like an IMDB.
SELECT *
FROM metadata_items AS I
INNER JOIN media_items AS M
ON M.metadata_item_id = I.id
INNER JOIN media_parts AS P
ON M.Id = P.media_item_id
INNER JOIN library_sections AS S
ON S.id = I.library_section_id
WHERE S.section_type = 1
AND file LIKE '%xxxxxx%'
Thanks to your help, I found exactly what I needed. With this, I can write a script that compares plex matches, to what I specified, and I can correct the ones that plex did not match correctly.
SELECT *
fROM taggings AS G
INNER JOIN tags AS T
ON G.tag_id = t.id
WHERE G.metadata_item_id = xxxxx
AND tag_type = 314
Care to elaborate? I have accidentally and intentionally mismatched IMDB IDs and folder/movie names, and Plex has always matched to the ID rather than the name. Haven’t tried this in a while, so perhaps the behavior with the new agent is different, but either way, I’ve never had a mismatch that I didn’t cause myself.
Sorry, not particularly. Too many trolls here. I tried to once, and all everyone wanted to do was crash on me about how it was my fault that the January update turned Plex into a real sloppy matcher.
Sorry.
I’d rather spend my time writing tools to help me fix the bad matches Plex does, and keep an eye on the matching that it does.
Ok. So I proved my theory. Despite all the hoopla about Plex matching to IMDB, it’s actually rarely true.
In my case, I have 16,524 movies. I wrote the query below, to figure out how many are actually matched to imdb. Only 2,425 are actually linked to an IMDB, even though all 16,524 have .nfo files set.
So once again, there is another bug in the new Plex scanner. This January release is really a huge pile of crap.
SELECT P.file, P.id AS media_parts_id, P.media_item_id, M.metadata_item_id, SUBSTR(tag, 8) AS tag
FROM metadata_items AS I
INNER JOIN media_items AS M
ON M.metadata_item_id = I.id
INNER JOIN media_parts AS P
ON M.Id = P.media_item_id
LEFT JOIN (
SELECT T.tag, G.metadata_item_id
FROM taggings AS G
INNER JOIN tags AS T
ON G.tag_id = t.id
AND tag_type = 314
AND tag like 'imdb:%'
) AS X
ON X.metadata_item_id = M.metadata_item_id
WHERE I.library_section_id IN (1, 11, 12)
Is there a problem with those that are not directly linked, though? I’m assuming they’re still matched, no?
I’ve been using .nfo files with just the IMDB URL for the past twelve years, first with XBMC/Kodi, then continued with Plex. And like I said, I’ve never had a movie mismatch. Switched over to the new Plex agents last summer.
Yesterday, I added a bunch of movies, and only one would not match, even though both folder and file were named correctly. As it turns out, the IMDB ID in the .nfo file had one too many zeros in it. To me, this proves that if an .nfo file is present, Plex will match strictly to that, and if the ID is incorrect, it will not even attempt to match otherwise.
Oh, I did not mean to imply that your links are wrong. I just wanted to describe what apparently happens if they happen to be incorrect.
If you feel like replying, I’m still curious if those thousands of movies of yours are not matched at all or just don’t show as matched when you run your script.