Query database for Movie Genre/Tags

I have about 2000 movies. I would like to correct some of
genre tags (eg, Mystery, Drama, Romance, etc) assigned to
each movie. I don’t want to click through all 2000 movies
one at a time. I wanted to get a list of all my movies
showing the titles and genre/tags associated with each
movie so I could quickly scan through the list.

I read this:

https://forums.plex.tv/t/howto-query-data-from-plex-on-a-mac/11636

and thought I knew enough and queried this database table / fields

metadata_items -> title,tags_genre 

and got (surprisingly!) good output.

Here’s an example output line:

The Bourne Identity|Mystery|Action

However, I quickly discovered that this query was not displaying all of
the tag genres. For example, for the above movie, if I use the webapp
to look at the tags on this movie, they are “Action, Thriller, Mystery”.
In other words, my SQL query did not find “Action”.

I tried adding/deleting/re-adding different genre tags to movies,
and that didn’t really do anything useful with my query output.
In all cases, the webapp found and displayed the genre tags
correctly.

It seems that the Plex SQL database is storing the genre tags in some
place besides metadata_items -> tags_genre.

I looked at some other tables (like tags), but I didn’t get anywhere.

Can someone explain how to query the database to get a correct list of
movie titles / genre tags ?

Take a look at ExportTools

Thanks for the suggestion, but it didn’t work: it has the same problem my
command line query does: it shows 2 genres, not the same 3 genres
that are shown in the webapp. I’ll see if there’s
a way to report a problem to the developers of the plugin.

How many copies do you have of The Bourne Identity? You could be querying one copy and looking at the other in the WebApp.
screenshot of my Db. You can see I can 2 copies from different matching agents and they have different genre tags.

Very clever thought, but I verified I have exactly 1 copy of “The Bourne Identity”.
I did refresh the Metadata, and nothing changed.

Just to be clear, I can use the webapp and remove all genre tags from this
movie. When I do that, the webapp shows no genre tags, and if I query
the database, it also shows no genre tags. If I then add 1 tag, webapp
and direct query agree. If I add a second tag, the webapp and direct
query agree again. But when I add a third tag (which can be unrelated
to the movie, like Biography), the webapp will report it but the direct query
will not.

Can you provide the SQL query?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.