# TV Series matching mismatch

**URL:** https://forums.plex.tv/t/tv-series-matching-mismatch/606149
**Category:** Metadata & Adding Files
**Tags:** server-linux
**Created:** [June 22, 2020, 2:56am UTC](https://forums.plex.tv/t/tv-series-matching-mismatch/606149 "2020-06-22T02:56:47Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![pythonjosh](https://avatars.discourse-cdn.com/v4/letter/p/278dde/32.png) [@pythonjosh](https://forums.plex.tv/u/pythonjosh)
#### Post date: [June 22, 2020, 2:56am UTC](https://forums.plex.tv/t/tv-series-matching-mismatch/606149/1 "2020-06-22T02:56:48Z")

</div>

Server Version#:1.19.4.2935  
Player Version#:Any  
Server: Ubuntu Server 18.04

Long time PMS user, tired of TV series not matching or mismatching.  
Examples from just today:  
Folder name: Perry\_Mason\_2020  
Mismatched to: Perry Mason (1934)  
Folder name: Lol\_Australia  
Did not match to: LOL: Australia  
Folder name: Double\_Cross\_2020  
Mismatched to: Double Cross (2013)  
Folder name: Central\_Park  
Mismatched to: Central Park West  
Folder name: Inside\_Monaco\_Playground\_of\_the\_Rich  
Did not match to: Inside Monaco: Playground of the Rich

Can we please have the matching criteria (Regular Expression) a user editable field? 75% of the time I add a new series, it doesn’t match correctly. Of the times I have to fix the match, about 50% of the time I have to get the TheTVDB\_ID because it won’t show in the search, with or without using the year field.

---

<div class="post-metadata">

### Author: ![pythonjosh](https://avatars.discourse-cdn.com/v4/letter/p/278dde/32.png) [@pythonjosh](https://forums.plex.tv/u/pythonjosh)
#### Post date: [June 22, 2020, 3:00am UTC](https://forums.plex.tv/t/tv-series-matching-mismatch/606149/2 "2020-06-22T03:00:18Z")

</div>

On the other hand, recent successful matches:  
Folder name: Impractical\_Jokers\_Dinner\_Party  
Folder name: The\_Politician  
Folder name: Amazing\_Animal\_Births

---

<div class="post-metadata">

### Author: ![FordGuy61](https://avatars.discourse-cdn.com/v4/letter/f/22d042/32.png) [@FordGuy61](https://forums.plex.tv/u/FordGuy61)
#### Post date: [June 22, 2020, 3:19am UTC](https://forums.plex.tv/t/tv-series-matching-mismatch/606149/3 "2020-06-22T03:19:51Z")

</div>

> [@pythonjosh](#):
>
> Folder name: Perry\_Mason\_2020

Plex is very picky with [TV show naming](https://support.plex.tv/articles/200220687-naming-series-season-based-tv-shows/) and directory structure. Try using Plex naming and organization guidelines.

See [Your Media](https://support.plex.tv/articles/categories/your-media/) → [TV Show Files (Naming and Organizing)](https://support.plex.tv/articles/categories/your-media/naming-and-organizing-tv-shows/).

When renaming and reorganizing, [Plex Dance](https://forums.plex.tv/t/the-plex-dance/197064) the entire show. This will remove the mismatched information from the Plex Server database.

For example, this matched without issue for me:

```auto
/A TV Show Library <-- TV Library points here
  /Perry Mason (2020)
    /Season 01
      /Perry Mason (2020) - s01e01.mkv
      /Perry Mason (2020) - s01e02.mkv
      /Perry Mason (2020) - s01e03.mkv
      /Perry Mason (2020) - s01e04.mkv

```

Edit: LOL: Australia did not auto match. The manual match found it immediately.

 ![Screenshot (56)](https://global.discourse-cdn.com/plex/original/3X/8/4/84b6ccaafbf45aa9916ca29b3c8c4cac61bef9c9.jpeg)

---

<div class="post-metadata">

### Author: ![pythonjosh](https://avatars.discourse-cdn.com/v4/letter/p/278dde/32.png) [@pythonjosh](https://forums.plex.tv/u/pythonjosh)
#### Post date: [June 22, 2020, 3:33am UTC](https://forums.plex.tv/t/tv-series-matching-mismatch/606149/4 "2020-06-22T03:33:07Z")

</div>

Allowing spaces in file/folder names is not only bad practice, it makes writing code to accommodate for it quite difficult. In Linux based systems it is even more difficult. That’s just the OS’s option to allow it. Now onto Plex’s logic pertaining to spaces in folder names. Their code “requires” this bad practice in naming. And requiring a colon in the folder name as well? This isn’t good file system management.

---

<div class="post-metadata">

### Author: ![pythonjosh](https://avatars.discourse-cdn.com/v4/letter/p/278dde/32.png) [@pythonjosh](https://forums.plex.tv/u/pythonjosh)
#### Post date: [June 22, 2020, 3:35am UTC](https://forums.plex.tv/t/tv-series-matching-mismatch/606149/5 "2020-06-22T03:35:34Z")

</div>

I posted successful matches for the purpose of showing that Plex does allow for filenames without spaces. This needs to be improved.

---

<div class="post-metadata">

### Author: ![ChuckPa](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/chuckpa/32/79710_2.png) [@ChuckPa](https://forums.plex.tv/u/ChuckPa)
#### Post date: [June 22, 2020, 3:35am UTC](https://forums.plex.tv/t/tv-series-matching-mismatch/606149/6 "2020-06-22T03:35:37Z")

</div>

If I may?

That’s why we have `"` and `'` in Linux as well as `\`

“\_” is not whitespace. That’s the problem here.

I’ve been coding for a long time in shell scripting and programming.  
Spaces are something you get used to and becomes second nature.

---

<div class="post-metadata">

### Author: ![FordGuy61](https://avatars.discourse-cdn.com/v4/letter/f/22d042/32.png) [@FordGuy61](https://forums.plex.tv/u/FordGuy61)
#### Post date: [June 22, 2020, 3:43am UTC](https://forums.plex.tv/t/tv-series-matching-mismatch/606149/7 "2020-06-22T03:43:13Z")

</div>

> [@pythonjosh](#):
>
> And requiring a colon in the folder name as well?

Just leave out any illegal/special characters. Use `LOL Australia`.

> [@pythonjosh](#):
>
> I posted successful matches for the purpose of showing that Plex does allow for filenames without spaces.

You got lucky. It works until it doesn’t.

Here’s a post from @ChuckPa with details on how Plex matches things:

> [@Naming conventions](https://forums.plex.tv/t/naming-conventions/549350/13):
>
> If I may add here, having gotten a much deeper understanding of how the matching software works tonight from the dev himself, I am using the example given. I’ve not tested in it in this form. I am writing here only to explain how it works and this was the first-available example. During automatic matching, Everything found is used. Dark.Waters.2019.720p.AMZN.WEB-DL.DDP5.1.H.264-NTG.mkv) is broken into words Dark+Water+2019+720p+AMZN+WEB-DL+1+H+264+NTG and used as the search criteria. T…

---

<div class="post-metadata">

### Author: ![pythonjosh](https://avatars.discourse-cdn.com/v4/letter/p/278dde/32.png) [@pythonjosh](https://forums.plex.tv/u/pythonjosh)
#### Post date: [June 22, 2020, 3:46am UTC](https://forums.plex.tv/t/tv-series-matching-mismatch/606149/8 "2020-06-22T03:46:14Z")

</div>

Is anything other than “space” whitespace? I’ve been coding for 20 years as well. Allowing spaces in filenames is not optimal.

Btw, I’ve been a Plex user for over 5 years, I’ve known of this limitation, and I post these to gripe about it until Plex allows for this. Hell I’d love to do it for them/us. But giving the user access to use our own Regex matching patterns would help out everybody.

---

<div class="post-metadata">

### Author: ![ChuckPa](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/chuckpa/32/79710_2.png) [@ChuckPa](https://forums.plex.tv/u/ChuckPa)
#### Post date: [June 22, 2020, 3:49am UTC](https://forums.plex.tv/t/tv-series-matching-mismatch/606149/9 "2020-06-22T03:49:47Z")

</div>

I can do you one better. 🙂

The entire matching system, as we have it now, is done in Python.  
That’s being replaced completely by C++.

Python is terrible at tokenizing and string processing where C++ slices and dices with ease.

I’ve tried the new scanner for movies. The test comparison is, with my names perfectly named by FileBot, :

What would take 3-4 hours on Python, with at least a few misses

- becomes -

7 minutes with zero misses over my 40 Mbps bonded VSDL line.

There is a forum thread where you can try it on the movie scanner.  
The TV scanner is being finished now as we discuss here.

---

<div class="post-metadata">

### Author: ![pythonjosh](https://avatars.discourse-cdn.com/v4/letter/p/278dde/32.png) [@pythonjosh](https://forums.plex.tv/u/pythonjosh)
#### Post date: [June 22, 2020, 3:53am UTC](https://forums.plex.tv/t/tv-series-matching-mismatch/606149/10 "2020-06-22T03:53:27Z")

</div>

For the most part, no issues with movie matching. Also helps that I don’t know the website it scrapes from, whereas with TV I know [TheTVDB.com](http://TheTVDB.com)  
I’m tempted to try out the new movie scanner.

---

<div class="post-metadata">

### Author: ![ChuckPa](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/chuckpa/32/79710_2.png) [@ChuckPa](https://forums.plex.tv/u/ChuckPa)
#### Post date: [June 22, 2020, 3:54am UTC](https://forums.plex.tv/t/tv-series-matching-mismatch/606149/11 "2020-06-22T03:54:08Z")

</div>

Here is the thread:

> [@New Plex Media Server movie scanner and agent preview](https://forums.plex.tv/t/new-plex-media-server-movie-scanner-and-agent-preview/593269):
>
> What is it and what’s new? We’re working on some upgrades to our movie metadata infrastructure, and we’d like to give you a peek at what’s in store. The major changes are a brand new scanner and agent, rebuilt from the ground up to be lean and super speedy, and a cloud-based metadata service that does all the heavy lifting to bring together multiple metadata sources such as IMDb, TheMovieDb, Rotten Tomatoes, and more to provide you with the best metadata in one place. We’d like to invite you to…

---

<div class="post-metadata">

### Author: ![pythonjosh](https://avatars.discourse-cdn.com/v4/letter/p/278dde/32.png) [@pythonjosh](https://forums.plex.tv/u/pythonjosh)
#### Post date: [June 22, 2020, 3:55am UTC](https://forums.plex.tv/t/tv-series-matching-mismatch/606149/12 "2020-06-22T03:55:39Z")

</div>

Btw the scripts I’ve made for my system are Perl for some, Python for others.

---

<div class="post-metadata">

### Author: ![ChuckPa](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/chuckpa/32/79710_2.png) [@ChuckPa](https://forums.plex.tv/u/ChuckPa)
#### Post date: [June 22, 2020, 3:56am UTC](https://forums.plex.tv/t/tv-series-matching-mismatch/606149/13 "2020-06-22T03:56:21Z")

</div>

what exists here is Python 2.7 based. That should explain a great deal ?

---

<div class="post-metadata">

### Author: ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)
#### Post date: [September 20, 2020, 3:56am UTC](https://forums.plex.tv/t/tv-series-matching-mismatch/606149/14 "2020-09-20T03:56:22Z")

</div>

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