Monday, March 01, 2010

Convenient Batch Re-Titling of TV Series

Have you ever downloaded or archived a TV series? Chances are, unless you meticulously hand-labeled the episodes yourself, you ended up with a grab-bag of assorted wretchedly deformed file names. Things like:

history.channel.aXXo51_[DVR]the_making_of_shoes[HI_QUALITY].AVI
the_three_stooges.1x5.the_voice_of_spring.DVDRip.sTeAlTh.XVID.avi

The OCD neat-freak in me rebels at the very sight of these. They're difficult if not impossible to search for in a file system, and are so cluttered with meta-information that they take a moment to even recognize what they are. The lack of white-space in the names is torturous to the eye. Contrast that with the following:

History Channel - The Making of Shoes.avi
The Three Stooges - S01EP05 - The Voice of Spring.avi

Much cleaner, isn't it? The only concession to short-hand is the Season/Episode identifier, mainly because it would absurdly long without compacting that information. Of course, given that a typical season can run 26 episodes in length, re-entering the information by hand can be anywhere from tedious to masochistic.

Fortunately, there's a better way. Many bulk re-naming tools with wide feature sets exist, but my personal favorite is ReNamer, available in both portable and installable formats. ReNamer's killer feature that sets it above most others is the near real-time application of all the naming rules in the list together, so you can see the final product as you build up rule sets. You can also turn on/off rules in the set with check-boxes, making it easy to find out which rules are causing problems and iteratively fix renaming rule sets. I've created a 22-rule set that can be used to re-name TV series, fixing most of the common naming problems. You can download the file here. Just drop the file into the 'Presets' folder inside the ReNamer program folder, and you're good to go! It will appear under the Presets > Load menu.

You can add files simply by dragging and dropping them into the lower pane. (Note: for some odd reason, this doesn't work on Vista/Windows 7 if you're running the program as an administrator. Go figure. You can still add files from the menu.) The Ctrl+A key combination ('select all') makes it easy to snap up all the files in a folder for dragging. You can see on the left the current name, and on the right the new name. If you're satisfied, you can go ahead and hit 'Rename' in the upper-right corner to actually rename the files, or you can mess with the rules as needed to set the names up like you want them.

Now, I'll go into a bit of detail about what the rules themselves do, since there's no way to add commentary, and some of them are fairly long and/or complex.

  • Rules 1 & 2 remove periods (except in the extension) unless they're surrounded by numbers on both sides. (So decimal numbers will be left as-is.)
  • Rule 3 removes common format/source meta information acronyms that are more or less irrelevant if you have the proper codecs.
  • Rule 4 replaces underscores in the middle of a word with spaces.
  • Rule 5 replaces any "-blah" sequences at the end, which can be useful if there are a lot of contributor screen-names tacked onto the end of the file name. It's disabled by default, as it can remove unintended title information. (For instance: D-Day.avi)
  • Rule 6 is a placeholder for you to add removal commands for other common strings that don't belong, such as a contributor screen-name or a format tag. Note that when editing it, you can use the "+" button to add more than one string search. Look at rule 3 for an example of how to use it. It is also disabled by default.
  • Rule 7 cleans up any mish-mash of spaces, dashes, underscores and periods left hanging around at the end of the file name from the clean-up so far.
  • Rules 8-10 reduce multiple occurrences of spaces, dashes, and periods anywhere in the name to a single one.
  • Rule 11 forces everything to lower-case to make it easier to deal with grammar corrections.
  • Rule 12 fixes missed apostrophes on common contractions.
  • Rule 13 puts everything back into proper first-letter capitalization for titles.
  • Rule 14 de-capitalizes in-between words that shouldn't be capitalized in a title.
  • Rule 15 undoes rule 14 whenever an in-between word is the first word in a group.
  • Rules 16 & 17 capitalize roman numerals (in the middle of the title or at the end)
  • Rules 18 & 19 convert most episode naming conventions to the S#EP# format
  • Rules 20 & 21 convert S#EP# to S##EP## with fixed numbers of digits (inserting leading zeros if needed) to make the names sort properly in a list view.
  • Rule 22 changes most variations of "part 1 - subtitle" to "(Part 1) - subtitle". (With or without subtitles)
  • Rule 23 interprets a trailing number as a part, and renames it to "(Part #)". Because this can misinterpret title information (such as "Apollo 13"), it is left disabled by default.
These are not by any means fool-proof. It's worth mentioning a small list of things that won't be fixed, and have to be checked manually:
  • Missing or incorrect title information
  • Possessive apostrophes ("Sallys day out")
  • Acronyms ("Us Guns of World War II")
  • Mixed trailing numbers ("Amazing Videos 2" & "Apollo 11" in the same batch, one will have to be manually corrected)

However, these rules should help save you a lot of work. There may be a few bugs still lingering in them, it's definitely a work in progress, but anyone with an OCD neat-freak streak in them will probably want to customize the rules anyway to suit themselves.

Labels: ,

0 Comments:

Post a Comment

<< Home