USAGE: TVFileRenamer fileToRename [baseTVShowsDirectory] This program will use theTVDB.com to parse a file of name "Series Name - Episode Name (Date)*" to "Series Name.SnnEmm.Episode Name (Date)*" Where nn = season number and mm = episode number If baseTVShowsDirectory is specified, it will place the file in the "baseTVShowsDirectory/Series Name" directory
> java -jar tvdb-renamer-with-deps.jar "c:\Tivo\Chuck - Chuck Versus the Anniversary (09_20_2010).mpeg" Renamed c:\Tivo\Chuck - Chuck Versus the Anniversary (09_20_2010).mpeg to c:\Tivo\Chuck.S04E01.Chuck Versus the Anniversary.(09_20_2010).mpegNow let's assume you want to put the file into a "Chuck" directory under c:\TVShows:
> java -jar tvdb-renamer-with-deps.jar "c:\Tivo\Chuck - Chuck Versus the Anniversary (09_20_2010).mpeg" c:\TVShows Renamed c:\Tivo\Chuck - Chuck Versus the Anniversary (09_20_2010).mpeg to c:\TVShows\Chuck\Chuck.S04E01.Chuck Versus the Anniversary.(09_20_2010).mpegIf there is no match in TheTVDB for the Series or Episode, then the file will remain unchanged. Usage with KMTTG I wrote TVDB Renamer to I could use it as a custom job within the excellent kmttg application so that downloaded TiVo files would be sorted and named appropriately. The first thing to do is make sure that kmttg is naming your downloaded files according to TVDB Renamer's expected filename pattern. In kmttg's config -> File Settings, under File Naming, I use
[title] ([monthNum]_[mday]_[year])Note that you can use whatever you want within the ()'s but currently you do need some parenthesis for the match to work. I wrote a small Windows command file to wrap the invocation of TVDB Renamer and called it tvdb.cmd and put it in my /bin directory:
@echo off java -jar [path_to_tvdb-renamer_jar]/tvdb-renamer-with-deps.jar %*Next step is to configure the custom job in kmttg. In the kmttg configuration dialog, under the "Programs" tab, I have added the following as a custom command: c:\bin\tvdb.cmd [mpegFile] g:\tvshows Custom Mappings
For various reasons, sometimes the name of the series you download doesn't match the name in theTVDB.
For example, "Law & Order: Special Victims Unit", as it is known in theTVDB, cannot be written as a filename in Unix because of the & and the : and in Windows because of the :. So your file will probably be something more like "Law and Order Special Victims Unit."
To work around this, you can specify a custom mapping file to TVDB Renamer. You can tell it either which "real" Series Name to use, or which TVDB series IDs to use. So you could do:
Law and Order Special Victims Unit=Law & Order: Special Victims Unitor
Law and Order Special Victims Unit=75692
The only character you can't specify in a series title is "=", which is what divides the two values in a mapping file. Leading and Trailing whitespace is ignored.
To supply the file to TVDB Renamer, use a Java system property called "map". So to modify the Windows command file example above, I might create a mapping file at c:\mappings.txt (any file name will do) and modify my script as follows:
@echo off java -Dmap=c:/mappings.txt -jar [path_to_tvdb-renamer_jar]/tvdb-renamer-with-deps.jar %*