Some sort of misbehaviour: renaming NFO files

kibje

21-01-2011 04:33:43

I regularly get renames because people have been changing stuff on theTVDB.
Usually the rename gets undone a day or 3 later and the next time I run tvrename all the episodes concerned are named back.
I do not mind this behaviour of TVRename: it seems to be the intended use to follow the value theTVDB
Except sometimes either the original file is not deleted or something else happens and I end up with two NFO files for the same episode but with a different name.

Some Show - S01E01 - New Episode Name.avi
Some Show - S01E01 - New Episode Name.nfo
Some Show - S01E01 - Old Episode Name.nfo

This is not a big issue; after all NFO files are small and my media center (XBMC) ignores the wrongly named file because there is no avi with the same name.
After the change is undone, TvRename will try to rename both the avi and the nfo that exist.

Now I will get an error in TvRename

Cannot create a file when that file already exist

I now have to manually get into the folder structure and remove the offending nfo before all my NFO files will be correct.

I wonder: Is it possible to overwrite the file and continue with the removal of the original one instead of throwing an error?