Hey folks, before I fully commit myself to trying to learn javascript, I figure I should check with the pros and see if something like this already exists. I recently downloaded all the subtitles for an old TV show that I have on our NAS. I muxed those subtitles without issue into the mp4 files, but as it turns out, my roku doesn't care for that. It wants separate .srt files that have the exact same name (case sensitive) as the mp4 file.
Unfortunately, the subtitle files are listed in alphabetical order so I can't just use a quick Autohotkey script to Alt+Tab between the folders and rename via copy/paste. I need a way to have it start with the first file in my Episode list (Folder 1) and use the episode title to find a match within the Subtitle folder and rename it.
If it was really fancy, it would rename exact matches, but if it wasn't identical, it would append a prefix ~ (to have it appear at the top) and append the renamed file to the old file name so it can be verified manually...not sure if that makes sense. My concern is if there are episode names that are similar or have the same title with a "Part 2" it would rename a file that's already been renamed. Maybe a different prefix in front (_) that tells the script to ignore it so it doesn't rename a file more than once? It would be easy to remove those prefixes after review.
Anyway, thanks in advance for your time and consideration, folks!
Example:
Folder 1 (Episodes 1-150)
TVShowName - S01E01 - Dark Side of the Moon.mp4
TVShowName - S01E02 - Take Me Out to the Ball Game.mp4
TVShowName - S01E03 - It's Beginning to Look a lot Like Christmas.mp4
TVShowName - S01E04 - Fourth Episode of this Show.mp4
...
Folder 2 (Subtitles)
Dark Side of the Moon-XIENFJVKDEFAEF.en.srt
Fourth Episode of this Show-RANDOMLETTERS.en.srt
It's Beginning to Look a lot Like Christmas-FJKDEIFf345FF.en.srt
Take Me Out to the Ball Game.en.srt
...
Folder 2 (Subtitles) After Script is Run
TVShowName - S01E01 - Dark Side of the Moon.srt
TVShowName - S01E02 - Take Me Out to the Ball Game.srt
TVShowName - S01E03 - It's Beginning to Look a lot Like Christmas.srt
TVShowName - S01E04 - Fourth Episode of this Show.srt
...
I guess they could all be in the same folder and just compare .mp4 against .srt extensions. This was just easier for me to visualize and explain this way.