(2013-06-09, 20:25)m.savazzi Wrote: I renamed all of my files to have TMDB numbering
It's quite easy with TheAdvancedRenamer
I couldn't find that tool, but using Ember to set the season/episode #s in the NFO made the process of actually renaming all of the files to make XBMC happy an absurdly simple one.
I tried to look at the listed rename tools on the XBMC wiki but the ones that contact TVDB or tvrage weren't flexible enough to get the job done reliably for all of the episodes. One that came particularly close, but the javascript custom rename action mechanism didn't let me create an ActiveX object to extract the data from the NFO file. (There were about ~720 episode files that needed renaming, if it was ~100 it wouldn't have been that bad, but I just wasn't going to rename that many episodes manually, ugh.)
Once Ember had generated the proper NFO files a simple Python program did the renaming for me.
The Python code simply finds all media files under the root path, parses the expected .NFO file and constructs an appropriate new base name based on the season/episode/title in the NFO file. It then renames the original base to the new one (i.e. Dr Who - blah blah* to S002E002_blah blah*). This includes the original media file, the NFO file, and any thumbnail files.
I needed to special case the title portion of the file name some to deal properly with Doctor Who reconstructed episode notation. Otherwise, I'd post the code for others.
After that ran successfully I then wrote another tiny program to take the "(reconstruction)" in the file name and migrated it into the .NFO <title> element so XBMC would show if the episode was reconstructed.
Trivia for the bored:
Some of Dr Who's original episodes were lost due to the BBC not archiving them properly and they were actually thrown away. The reconstructed episodes feature some video bits interspersed with either narration/episode audio and photos taking during the filming of the episode. Thus why it's interesting to know in XBMC if the episode is one of these reconstructed suckers.
Bill