Friday, July 2, 2010

Renaming Beyond TV Files For Media Center

It's probably not surprising that there have been a few different projects to rename files created by Beyond TV so other media managers can make use of them and find their metadata.   I looked over the ones with the most recent activity in the Snapstream forums and decided to give a program called btv_to_xbmc a try.  It uses a configuration file to make it more flexible than most and allows setting of specific TVDB Ids for resolving duplicates.  It also has options to create folders by series and season and move the files to the proper directories. 

It's also written in PHP which is a little unusual for a program like this, but that actually worked to my advantage.  "Out of the box" so to speak, the script replaces spaces in episode names with periods, and puts a period between the season and episode numbers as well.  I had a hard time finding a metadata manager that supported that format, and even when I found one, I was still seeing episode names like "CSI.Crime.Scene.Investigation" which I wasn't crazy about.  I was able to modify the character substitutions in the configuration file to no longer replace spaces with periods in the series and episode titles.  I was still seeing the season folders with a format of "Season.1" which was also how they were displayed in Media Browser, so I wanted to change that.  It turns out that I needed to modify the scripts directly since the season folder naming format was hard-coded.   I'm not much of a PHP programmer, but I was able to locate the relevant code easily enough.  It was a bit unsettling looking through the code since the author is in the habit of putting his/her initials in the code and it turns out we have the same initials.

I've run this script on a fairly large chunk of my collection now and it works very well.  It does a good job of finding the metadata it needs and organizes the file by series and season.  One thing I hadn't thought of before, though, was that it doesn't know where to find the commercial identification files ShowAnalyzer creates for Media Center, so I've got a bunch of orphan files I need to clean up.   I'll need to modify the btv_to_xbmc script to find and rename those files before I run it on the more recent files.

No comments:

Post a Comment