Add support for new Plex Premier Date Detection

Request Type:

MCEBuddy Version and Type (32bit or 64bit):
2.4.11, x64

Operating System and Type (32bit or 64bit):
Server 2016, x64

Summary of the problem or suggestion:
Historically, I have used a Regex metadata correction to match Plex-recorded TV shows to TVDB. I used this to remove the year before the match. However, I read that in 2.4.10 and later, the behavior has changed so that the year is assigned to another field (Premier Date) and so the lookup works properly now.

Unfortunately, I do not have success with this. I updated to 2.4.11, but it looks like it is attempting to lookup the full title on TVDB [“Dateline NBC (1992)” instead of just “Dateline NBC.”] I do not see the “Premier Date” as a field in the logs. The subtitle is also wrong, but that’s a function of Plex’s new crappy EPG not getting S##E## numbers, and I’m hopeful I can fix that with a Regex filter or something in MCEBuddy.

I can change to 2.5.1 if that would make a difference.

Steps to replicate the bug:
Convert a file name with the title “Dateline NBC (1992) - 2019-09-13 08 00 00 - Into the Dark.ts” and check the logs. It appears that matching is failing.

I’ll attach logs.

Dateline NBC (1992) - 2019-09-13 08 00 00 - Into the Dark.ts-Convert to MP4-2019-09-28T15-48-57.1925948-04-00.log (66.0 KB)

Update: It appears that the format of the file name is causing MCEBuddy to be unable to do two things:

  1. Accurately determine the episode title (the original broadcast time is being pre-pended to the subtitle while the original broadcast date is captured/matched properly)
  2. Strip out the year from the title and use as the premiere date

I have just updated to 2.5.1 with the same results.

I’m attaching a log of a successful conversion for another file. The reason this one works is that instead of a timestamp in the file name, it has S##E## naming. Unfortunately, with Plex’s new EPG provider, these issues are happening very frequently, and this will continue to be a problem going forward as the new provider does not always have S##E## naming structures. I feel MCEBuddy can still work with this as the episode title is correct, but stuff is not going in the proper fields, so its failing.

48 Hours (1988) - S32E02 - The Case Against Brooke Skylar Richardson.ts-Convert to MP4-2019-09-30T10-51-07.0566363-04-00.log (2.1 MB)

Update 2: I have determined a format that MCEBuddy can work with, but it requires Regex, and either the Regex parser is not working correctly, or it only matches on the title after some initial processing and does not give access to the entire file name (more likely, in my opinion).

If I use regex:^(.*) \(\d{4}\).*(\d{4}-\d{2}-\d{2}) \d{2} \d{2} \d{2} - (.*)$ as the original title and regex:$1 - $2 - $3 as corrected title, I would expect to see MCEBuddy process the filename as Dateline NBC - 2019-09-13 - Into the Dark, but it does not, so it is not matching.

Does the parser built-in to MCEBuddy allow me to transform in this method, or no? Do I need another program like PowerShell to monitor the directory for new files and transform the files before MCEBuddy gets them? Does MCEBuddy need an update? Am I not using it correctly? What’s the best way to get from where I am to where I need to be?

We’ll need to add support for that new naming format. Can you attach the logs where the regex doesn’t work? That should work.

Sure. Attached is a log where I tried to use the regex. In this one, I made it less restrictive by removing the ^ at the beginning and the $ at the end in case it was seeing the full path, but it still didn’t match. Thanks!

Dateline NBC (1992) - 2019-09-13 08 00 00 - Into the Dark.ts-Convert to MP4-2019-09-30T16-05-23.6045972-04-00.log (65.5 KB)

I checked your logs and your regex doesn’t match the title. The filename Dateline NBC (1992) - 2019-09-13 08 00 00 - Into the Dark is parsed by MCEBuddy as:

2019-09-28T15:49:21 MCEBuddy.MetaData.VideoMetaData --> Video Tags extracted from file/name metadata ->
Title: Dateline NBC (1992)
SubTitle: 08 00 00 - Into the Dark

So you’re trying to apply ^(.*) \(\d{4}\).*(\d{4}-\d{2}-\d{2}) \d{2} \d{2} \d{2} - (.*)$ to the Title Dateline NBC (1992), doesn’t doesn’t match hence it ignores it.

That being said, MCEBuddy doesn’t support transformation yet, it’s something we can look into adding. Currently it only supports matching regex (to the Title) with a static replacement, but as I mentioned above your regex doesn’t match the title.

Slight correction, MCEBuddy does support a regex transformation but due to a bug it doesn’t remove the regex: at the beginning of the corrected title, just enter the transformation text without the regex: and it should work. We’ll fix this in the next build.

So in your case this is how it should look to match the title Dateline NBC (1992):
Original title: regex:(.*) \((\d{4})\)
Corrected title: $1 - $2

This will produce Dateline NBC - 1992

Got it, thanks! I’ll change that around.

So, my issue is that the subtitle of 08 00 00 - Into the Dark isn’t actually the subtitle. The subtitle should just be Into the Dark. MCEBuddy appears to be parsing the time portion of the broadcast date and prepending it to the subtitle. As such, the metadata lookup is failing.

This wasn’t a problem before because the Plex EPG was decent and always had S##E## instead of timestamps (and MCEBuddy assigned those correctly), but now that files are starting to come in with timestamps, MCEBuddy seems to be having trouble. Is there anyway to fix that, or do I need to have something rename the file before MCEBuddy sees it?

We’re adding support for reading that new format. Your example above shows how a series is named in the new Plex format

Showname (premiere year) - Recorded Date Time - Subtitle

Do you have examples for a movie or sports or news naming?

We’re adding support for reading that new format.

Ahh, okay. That’s great! Looking forward to it! I have a PowerShell renamer running in the meantime to get it to match, but native to MCEBuddy is definitely preferred.

Do you have examples for a movie or sports or news naming?

Truth be told, I almost never use MCEBuddy for this, so I couldn’t tell you, but I’m more than happy to do some test records for you if you need to see what Plex does with it.

1 Like

Yes, that would help to ensure it captures them all correctly

No problem. I’ve set a couple to record. I’ll post back when I have the results.

Sorry this took a bit. There weren’t actually any OTA sports programs on for a while. Here is what the Thursday Night Football game looks like:

NFL Football (2019) - 2019-10-03 08 00 00 - Los Angeles Rams at Seattle Seahawks.ts

Here is what the local news looks like:

13abc Action News at 5 00PM - 2019-10-01 17 00 00 - 13abc Action News at 5 00PM.ts

Let me know if you need anything else.

A movie please

A movie looks simpler:

Multiplicity (1996).ts

Support for this new plex naming format has been added and will be available tonight beta build.

Supported formats details are available here: Metadata matching, extraction, renaming from files and downloading from the Internet

However at this time there’s no way to differentiate between sports and series since they have the exact same naming pattern. You can try to use the force show type option for sports shows with custom filename filter in the conversion task.

Fantastic. Thanks for your hard work on this!