Okay, so looks like I’ve solved this.
I moved the affected shows into a new folder, and ran this command:
find /volume1/video/Dance -type f -iname '*.mp4' -exec ffmpeg -i "{}" -map_metadata -1 -c:v copy -c:a copy "{}.clean" \; -exec mv "{}.clean" "{}" \;
which iterates through all of the MP4 files, using ffmpeg to strip the metadata from the files. Once I’d done that, moving back into the collection results in Plex scanning and identifying the files and pulling in their metadata correctly.
My McMafia is as it should be - 8 shows in one season. So I think what was happening is this:
- Ripping shows via get_iplayer sometimes writes ‘get_iplayer’ into the Show metadata tag.
- Plex scans the files, correctly identifies the series/season from the folder, but then reads the metadata tag and pulls the wrong show information from TheTVDB.com
- Because McMafia was also ripped via get_iplayer, it was there first, so the other shows were grouped underneath it.
- Disabling LMA or moving LMA to the bottom had no effect and the local MP4 metadata tags were taken into consideration by Plex when identifying the shows/episodes.
- All the stuff about file system corruption, system load, SqlLite transactions, etc., etc., were nothing to do with this and a red herring.
- Doing the Plex Dance has no effect, because it’s the Plex scanning algorithm that’s fundamentally flawed in this case.
The solution for this, as surmised earlier, is for Plex to be fixed so that either:
a) Moving LMA to the bottom and/or disabling it really really causes it to ignore Local Media Assets - including MP4 tags or
b) Plex needs a new option to be set called “Never ever ever read MP4 tags - ignore them all”
Additionally, given how strict Plex is in its naming/directory structure requirements, it seems utterly absurd that it would group shows that fall under completely distinct series folders into a single series, purely on the basis of some MP4 tags. Either Plex requires the folder structure layout that’s recommended in all of the articles about media preparation, or it doesn’t. If it does, then it should have flagged up an error to the user: “Multiple shows in different series folders with the same series name” and asked the user to resolve it.
How do we log and track an issue with the Plex development team? Can you do that Chuck?
In the meantime, I’m going to put a little script together that runs to periodically clean up MP4 metadata tags (I might write a utility that checks for tags, and only deletes them if they exist, so it runs quickly, and have this run daily on my library).