Fixed episode matching, files deleted after mass rename

TL;DR, messed up episode order, fixed matching, mass renamed, Sonarr does not handle file name collisions correctly and deletes half of the files while throwing exceptions.

Issue has happened multiple times with seasons packs on this one show. It’s the uploader’s fault, they don’t use correct file numbering, so halfway through the season it all gets shifted by 1 number (i.e. episode 10 named e10e11, and episodes 11 upwards mislabeled 12 etc.)

I’ve manually fixed the matches for each episode every time in the Sonarr UI, then tried a mass rename to fix the file names.
Here’s where Sonarr messes up:
I end with half the episodes (say all the odd number ones) correctly named, but the other files missing.
I think Sonarr is blindlly renaming without checking for collisions and doing it in a meaningful order, so it force replaces half the files on renaming. Since nothing is “deleted”, it doesn’t even move them to the specified folder, forcing me to manually grab the release all over again.

There’s an exception in the logs:

Running on Docker on a Synology.
Version 3.0.8.1507
Package Version 3.0.8.1507-ls147 by linuxserver.io
Mono Version 6.12.0.122

Info logs are not helpful for debugging.

For this at least debug, but better yet - trace is needed. This was in the post template which linked to the wiki