TV Shows - naming incorrectly

For some reason my shows have stopped naming correctly, but only for .mp4 files??

In Sonarr my rename settings are:
{Series Title} - S{season:00}E{episode:00} - {Episode Title}

This gives me the following files in the directory
The Crown - S01E01 - Wolferton Splash.mp4
The Crown - S01E02 - Hyde Park Corner.mkv

In Plex this shows as:
RARBG.COM - The.Crown.S01E01.WEBRip.X264-RARBG
Hyde Park Corner

Why is this and what can I do to fix it?

thanks

I’ve resolved this, just wanted to update for anyone else looking.

Settings/Agents/Shows/TheTVDB: Make sure that “Local Media Assets (TV)” is below “TheTVDB” in the list. I have it at the bottom, under “Plex Theme Music”.

Once that is done move one of the files to another directory and Update…not refresh. Once Update is done (instantly), you’ll notice the remaining files are not renamed correctly…move the file back into the folder, Update again…and now you’ll see that all the files are named correcty.

That naming looks quite good and assuming that your structure is as well my guess is that you are picking up embedded metadata.

You can go to the trouble of removing the metadata from your mp4s or you can simply edit the library settings and move “Local Media Assets” below everything else.

To do that open your web app and select settings/server/agents and then click of “shows” and in “TheTVDB” and “The Movie Database” tabs grab “Local Media Assets” and move it down the list to the bottom.

That will prevent Plex from reading internal metadata instead of the other agents.

Once you do that you will need to perform “The Plex Dance” to force a reset of the metadata.

Hope that helps.

Edit: I see you fixed it before my post was finished. Good job.

It’s happening because PMS is picking up the embedded tags in the MP4. You can leverage Sonarr to take care of this.

This ‘Connections’ script takes care of it. It cleans all the unwanted information out by converting the file to MKV then using mkvpropedit to clean out the unwanted tags. I keep files as MKV to a) avoid these problems and b) save space.

This is how I do it:

/syno/sonarr is where Sonarr keeps all its information. Everything else is passed in through Sonarr variables.

[chuck@lizum sonarr.118]$ cat clean-mkv
#!/bin/sh

# this script runs when sonarr triggers (a download/rename) to clean properties, subtitles and attachments

Event=$sonarr_eventtype
Episode="$sonarr_episodefile_path"
Series="$sonarr_series_title"

# User specified log file
Logfile="/syno/sonarr/clean.log"
    
#echo $Event registered  $Series >> /syno/sonarr/clean.log

if [[ $Event == Download ||  $Event == Upgrade  ||  $Event == Rename ]]; then
  echo  `date` Cleaning: $Episode >> ${Logfile}
  rm -f temp.mkv
  mkvmerge -o temp.mkv -M -S --no-global-tags --disable-track-statistics-tags "$Episode"
  if [ $? -ne 0 ]; then
    echo `date` Bad file: Error \($?\) "$Episode" >> ${Logfile}
    rm -f temp.mkv
  else
    echo `date` "Keeping: " "$Episode" >> ${Logfile}
   mkvpropedit -s title="" temp.mkv
   mkvpropedit --edit track:a1 --set language=eng --edit track:v1 --set language=eng temp.mkv
   mv -f temp.mkv "$Episode"
   rm -f temp.mkv
  fi
fi

After this step is when Sonarr does the final move to place the file into my media library. PMS never sees the ‘dirty’ file.

Sonarr setup for the ‘Connection’