I'm in the process of switching from iTunes to Emby server to stream videos to my Apple TV. Emby does fine with movies, but for identifying episodes of TV series it needs the season and episode number in the file name.
Unfortunately, iTunes names TV episode video files using just the episode name. It has the episode numbers in its tags and database, but it doesn't put them in the filename. So a typical file location is:
TV Shows > Jeeves and Wooster > Season 1 > Jeeves Takes Charge.mp4
But what I want is:
TV Shows > Jeeves and Wooster > Season 1 > Jeeves and Wooster S01E01.mp4
Even just adding the episode number at the beginning would be great:
01 Jeeves Takes Charge.mp4
My library is large enough to make doing this by hand a pretty big time sink. Can iTunes be coerced to do it automatically? If not, is there a third-party tool or other ready-built solution? I'm sure it can be done in Applescript with Exiftool, but I'd prefer not to reinvent the wheel if someone else has already done it.
Best Answer
I still don't know if there's a way to compel iTunes to do it automatically, but I managed it with Applescript and ExifTool. In case it's useful to anyone else, below is the full script. You'll need to install ExifTool first. You can run the script to choose one file at a time, or export it as an application to do drag-and-drop.
It renames episodes like:
Show Name S01E01 Episode Name.mp4
which is a format recognized by Emby, Plex, and other media managers.
It processes folders recursively, so you can drag your entire TV Shows folder onto it in one go. It will skip files that aren't video or don't have the expected TV show metadata, and when it's done it pops up a dialog to tell you how many of each it encountered.