Why does plex swing and miss with matches so often?

I’ve noticed that Plex does a poor job of matching titles of movies against actual movie names unless the naming convention for Plex is followed to the letter. Specifically, I’m finding that most of the movies I’m importing into the system either don’t match at all or match to the wrong movie. And, it shouldn’t be doing such a poor job.

It seems that Plex’s match algorithm uses the FIRST result returned with a matching word in the title. Period. Exact match doesn’t get priority. Some examples:

Monsters.mkv -> Matches “Monsters, Inc.”
Twelve.mkv -> Matches “Twelve Monkeys”

Since I’m doing an initial import, my files aren’t currently in the ideal naming convention. But, I would think that an exact title match would take precedence over a “fuzzy” match that’s more popular (and hence returns earlier in the list). I’ve had to fix a ton of titles that are matched wrong that would have been right if exact match had priority.

For the record - I plan to write scripts that will modify the names of the underlying files according to the standards using the METADATA that Plex stores once a proper match is made.

There are auto-renaming programs already available. It’s best to rename prior to first scanning into your library. Many Plex users trust FileBot to provide the correct names and folders structure. The folder structure and naming produced will allow Plex (or Kodi or Emby) to match your media with nearly 100% accuracy.

FileBot
Plex naming schemes for FileBot

To answer your title question: Because you’re throwing balls so far and wide that Plex can’t hit them.

@ember1205 said:
For the record - I plan to write scripts that will modify the names of the underlying files according to the standards using the METADATA that Plex stores once a proper match is made.

You could always use filebot to rename your files. It even has a quick tag of {plex} to make renaming into the Plex convention a lot easier. I myself use a modified naming scheme because I like to put my video resolution at the end. But leaving the first 2 parts in tact allows the scanner to still match.

Monsters.mkv → Matches “Monsters, Inc.”
Twelve.mkv → Matches “Twelve Monkeys”

Neither of those follow the naming scheme so the scanner is going to have trouble with it. Plex looks for two things the name and the year. Without both you will only get half the information correct.

Since I’m doing an initial import, my files aren’t currently in the ideal naming convention. But, I would think that an exact title match would take precedence over a “fuzzy” match that’s more popular (and hence returns earlier in the list). I’ve had to fix a ton of titles that are matched wrong that would have been right if exact match had priority.

From the example you have given, you haven’t provided Plex any exact matches. Since Plex looks for a name and year providing only the name only matches half the information correctly. Below is fix incorrect match using the monsters example with the year:

As you can see the correct file has a score of 100 (In the right column) because both the name and the year matched correctly. Scrolling down Monsters, Inc. only has a score of 64.

From the example you have given, you haven’t provided Plex any exact matches. Since Plex looks for a name and year providing only the name only matches half the information correctly. Below is fix incorrect match using the monsters example with the year:

IMHO, I have given Plex exact matches. TMDB doesn’t return “Monsters (2010)”, it returns “Monsters” with 2010 as additional information. So, when the -required- naming convention isn’t available, and only a movie name can be had, I feel it should match filename against Movie Name and consider that a better match.

As far as the “score”, I didn’t even know what that was. Is that documented somewhere obvious? Maybe the match screen should be updated to name that column “Match Score” or something?

I’m aware of Filebot but have never used it. There is no native linux version, you have to use the portable version (or build your own, which I don’t have time for at the moment), and the portable version is poorly documented in terms of how to even install it and get it to work (I fought with it for a couple of hours before I at least got it to not throw errors, and I’ve got over two decades of experience with Linux and scripting). How does it understand that “Monsters.mkv” should be renamed to “Monsters (2010).mkv”?

If Filebot is a good tool to use to prepare media for scanning, are there any Plex-specific docs on setting it up and using it prior to import?

https://support.plex.tv/hc/en-us/articles/200381023-Naming-Movie-files

Monsters (2010) — The Movie Database (TMDb) - Monsters (2010) at TMDB
Note: If you go to TMDB and search for Monsters you’ll see there are many of them. If you run non-compliant files - without the (YEAR) - it’s a crap-shoot and you’re rolling ‘snake-eyes’.

FileBot is the #1 Plex Companion (links in my signature), but perhaps @rednoah42 can appear to discuss it’s use for ‘Linus’.

:slight_smile:

‘Fix Match’ is the safety net - when compliant naming, for some reason, doesn’t work. I’ve used it maybe 8 times over 10’s of thousands of library items.

This article explains the fix match screen:
https://support.plex.tv/hc/en-us/articles/201018497-Fix-Match-Match

The reason it’s not explained elsewhere is that to see the score on a normal match you need to look into the scanner logs to see the actual score. While fix match displays it right on screen since you’re manually selecting the match.

Unfortunately, if you’re only providing half the information the scanner is looking for it can’t get a perfect match as there will be a ton of different things that can match. While your search may only include the name the scanner doesn’t because of exactly what you are experiencing.

As you can see just searching for monsters like you said does return Monsters inc first from theMovieDB search. And even in the main search before hitting enter the specific movie you are looking for is the 3rd item returned.

Now looking at the exact name matches for ‘Monsters’ there is Monsters from 2010, Monsters from 2015, Monsters from 2004, Monsters from 2014, and Monsters with no year. How would you expect the agent to decide which is the specific one you are looking for?

However, if we use their tip under the categories and add the year we can get the correct movie returned first (In addition to reducing the results by 20 fold):

This is the exact reason Plex looks for both a name and year with the scanner.

@jmckee said:
This article explains the fix match screen:
https://support.plex.tv/hc/en-us/articles/201018497-Fix-Match-Match

The reason it’s not explained elsewhere is that to see the score on a normal match you need to look into the scanner logs to see the actual score. While fix match displays it right on screen since you’re manually selecting the match.

Thanks for the link. While I understand that it isn’t “explained elsewhere” for the reasons that you cited, it seems that I’m either in Match or Fix Match a lot. At least seeing a column heading so I understood what that number meant would have been useful.

Unfortunately, if you’re only providing half the information the scanner is looking for it can’t get a perfect match as there will be a ton of different things that can match. While your search may only include the name the scanner doesn’t because of exactly what you are experiencing.

Well, when all I have is half the information, that’s all I have to provide. And, I ran FileBot against a sample dataset and it had a similar percentage of missed matches compared to Plex. So, “preparing” the media wouldn’t have helped. In fact, this makes it worse because FileBot renames the directories and files to what IT thinks the files represent and I have wade through log files to understand what the name was originally (or play the movie to get the title) and then manually rename the directories and files. While I can see where FileBot can be helpful, it’s not very well documented, especially for those like myself that are all about automation and scripting and don’t use the GUI version. What’s worse is that I can’t even find docs to help me understand prerequisite packages for the Linux versions. Steep learning curve for me there because of this.

Now looking at the exact name matches for ‘Monsters’ there is Monsters from 2010, Monsters from 2015, Monsters from 2004, Monsters from 2014, and Monsters with no year. How would you expect the agent to decide which is the specific one you are looking for?

Honestly, my view is match based on what I gave it. Name and no year? And there’s an entry with an exact name match and no year? Then that should be what it matches to.

Maybe there could be some config options that let me choose how to handle matching. How about requiring a minimum score? And an explanation of how the scores are calculated? What should Plex do if a minimum score match can’t be found?

One of the things that frustrating when it doesn’t match correctly is that I have to:

  • Identify the incorrect match (hmmm… maybe a match score below a certain level gets an icon of some sort?)
  • Figure out what the correct matching title is (manual process looking the movie up myself - don’t see where I can avoid this one)
  • Rename the directory and file manually
  • Fix Match

That last step should be a configurable option as well… If the directory and/or filename change, I should be able to tell Plex to “re-match”. Instead, I have to do the match manually.

Don’t get me wrong… I think Plex is a nice piece of software and has a LOT of positives. For someone like myself that is in the process of creating my movie library “from scratch”, this is a TON of work because of all of the incorrect matches Plex makes. If it would skip the match initially so I could do it manually, that would actually be a LOT less work.

Another thing that would be great is if Plex could manage the underlying file and folder structure based on Matches. For example… If I manually match “Monsters.mkv” against the Monsters (2010) movie, it would be great if Plex would see that as a reason to create a “Monsters 2010.mkv” directory, move the file into that directory, and then rename the file to “Monsters (2010).mkv” as well. iTunes has this sort of option where you point it to a media file and tell it to import it. It “figures out” what the media file is and the puts it into an appropriately named directory and gives it an appropriate name on disk. Honestly, I’m surprised Plex -doesn’t- currently do this. Since I’ve done so much manual matching already myself, and FileBot has made so many mistakes in my tests, I plan to write my own maintenance scripts to read details from the database about each movie and do this renaming for me.

When following the media naming scheme, my Plex has been 99.9% accurate. If you name them right initially, it will work almost every time.

I understand that if I basically “do all the work” then Plex will get it right (essentially, that’s what taking the time to name correctly means). I was hoping that Plex would have more options for how to handle pieces of media that -aren’t- named according to the scheme when it tries to match.

Previously, I had ripped my DVD collection to ISO files and stored them on a linux server. The directories were not directly shared. Instead, I shared (via SAMBA) a directory with soft links to the actual files. My media players supported Windows file servers and I could regulate which media players could access what content based on permissions.

The naming convention that I used when ripping the movies was “Title.Rating.iso”. So, “The Mask” would be “Mask, The.PG13.iso”. I had maintenance scripts that would run every fifteen minutes and purge dead links and auto-create new links based on the titles. In the link directory, it would appear simply as “Mask, The.iso” (I removed the rating because that wasn’t something I was interested in when selecting a movie - I used that in a CSV file that was auto-generated to inventory the movies on my server).

Having over 1000 of these ISO files, already “well-named”, I wrote a processing script to pass them through MakeMKV, extract the main movie (wrote my own logic for handling movies that produced multiple files), and use the name of the original ISO file as the filename for the movie (with .mkv as the extension).

Now, “The Mask” is “Mask, The.PG13.mkv”. This produced matching issues as basically nothing matched. And I can understand that. So, I wrote another script to purge the rating out of the title and leave me with “Mask, The.mkv”.

I really didn’t want to have to go through over 1000 files manually, putting “The” at the beginning and adding (xxxx) to represent the year it was released. Plex got probably half of my library wrong in terms of matching leaving me with a ton of manual work to do anyway.

It has been a daunting task to say the least. Given the amount of heavy lifting that I’ve had to do, I’m trying to understand the logic behind the scenes of Plex to try and avoid so many mistakes WITHOUT having to still invest hours of my life looking up release years for all of these movies.

BTW… Using a purpose-built machine whose sole task is to rip DVDs directly to MKV files produced similar poor match results because ITS way of trying to identify the release year (based on calculating CRC’s of the discs and looking them up in an online database, or reading the year info directly from the BluRay info file itself) almost always got the release year wrong. This is especially true in the case of Disney movies and similar where the original release year is NOT the same as the DVD release year.

@ember1205 said:
I’m aware of Filebot but have never used it. There is no native linux version, you have to use the portable version (or build your own, which I don’t have time for at the moment), and the portable version is poorly documented in terms of how to even install it and get it to work (I fought with it for a couple of hours before I at least got it to not throw errors, and I’ve got over two decades of experience with Linux and scripting). How does it understand that “Monsters.mkv” should be renamed to “Monsters (2010).mkv”?

Here’s the man page.

What flavour of Linux are you using? The snap and aur package sources for Ubuntu and Arch are actively maintained. There’s an install script for everything else.

FileBot is not tailor-made for Plex, but it does make it easy to organize files for Plex by using the predefined {plex} binding in your --format.

The most relevant and most popular match for “Monsters” is hopefully the one you want. If not, then you can use --q and --filter to narrow things down. Please read FAQ #2 for details.

For example, if you know that the release year around 2011 or maybe few years earlier, then you could do something like --filter 'y in 2009..2011' to tell FileBot to only consider movies matching “Monsters” that were released between 2009 and 2011.

@rednoah42

Thanks for the links. From what I see, the man page seems to present the same information as the help output (or as running the program with zero parameters), only in an additional format.

I was eventually able to get it running on an Ubuntu box (which I’m not familiar with - I “grew up” on Slackware and now run openSUSE) with the .deb package. I can get it to function as intended but it is making some pretty big mistakes on me.

I did use the {plex} format binding, and the ones that matched correctly were fine (as expected). The ones that didn’t match were -VERY- wrong. Examples:

“Fury (2015).mkv” (mis-labeled as it should have been 2014) -> “Suffragette (2015).mkv”.
“Percy Jackson Lightening Thief.mkv” -> “Percy (1971)/Percy (1971).mkv”
“Grimm Love.mkv” -> “Grimm (2003).mkv”

I realize that FileBot is relying on third-party databases to match information that’s being gathered from the source file, but these “matches” aren’t matches at all. I worked around them by running the “test” parameter (which, by the way, doesn’t seem to be documented) and then improving the name of the source file before running FileBot again and allowing it to actually perform renames.

I think the format binding that’s hard-coded for Plex use makes things very helpful. I don’t want the top-level dir of “Movies” that’s hard-coded into it, so I execute a subsequent “mv” to relocate the files into a different directory. Have you considered leveraging an input file to read formatting expressions from? And distributing your examples and others that are currently compiled into the jar file in that file? Personally, I would have liked to have found the “plex” format, made a copy of it, changed it to not leverage the “Movies” directory, and then called that binding when I ran it.

I saw a comment in a FileBot forum thread about a “strict” option for naming, but it doesn’t seem to be documented.

The use of filters could be useful, but it seems that it isn’t documented. And, I didn’t see anything about it on the FAQ page you linked to. Is this something I use for just one file at a time? How do I supply a filter for a particular file while allowing FileBot to process files in bulk?

I’m going to register an account on the FileBot forum and will PM you over there as A) I’d like to better understand FileBot and B) would be happy to help with the documentation if you’re interested in closing some of these gaps.

New users often like to dance on the canvas with Plex, bobbing and weaving as Plex beats them into a pulp. Think - The Trillah in Manilla (they’re not playing the part of Ali and they have no corner manager to throw in the towel).

Eventually they realize Plex has no conscience, stomps them into a ‘them-shaped-divot’ in the ground and moves on to the next victim.

:slight_smile:

Sometimes files are named so badly not even FileBot knows what to do:
Percy Jackson Lightening Thief

  1. not even close to the name
  2. ‘lightening’ misspelled
  3. no year
    Still, FileBot probably offered several ‘alternatives’ to choose from. Selecting the correct one is key in this case.
  4. if TMDB isn’t in the top slot under it’s tab - bad juju occurs.

https://www.themoviedb.org/movie/32657-percy-jackson-the-olympians-the-lightning-thief
Percy Jackson & the Olympians The Lightning Thief (2010)

@ember1205 said:
I’m going to register an account on the FileBot forum and will PM you over there as A) I’d like to better understand FileBot and B) would be happy to help with the documentation if you’re interested in closing some of these gaps.

Yeah, that’d be best so I can update the docs as necessary.

Here’s a quick answer for the things mentioned here:

  • You can use bits and pieces of the plex binding: plex.tail, plex.name, etc
  • FileBot should is conservative (i.e. strict) by default, unless -non-strict is specified. The Fury is a working title for Suffragette so it kinda matches accidentally. Lightening is misspelled and throws off the search results. No idea what’s going on with Grimm Love though.
  • You can use --q and --filter or --mode interactive to force FileBot to select specific movie matches
  • Filter, like format expressions, can do things I wouldn’t even think of, so the documentation consist primarily of useful examples, but anything is possible

Thanks for the follow-ups, @rednoah42

I did register an account on your site but it won’t let me send PM’s because I haven’t been posting in the threads.

Good tip on the interactive option, but with 1000 titles still to rename… :slight_smile: