Improper renaming when one show name is a subset of another

rwmnau

09-06-2011 03:34:51

I have both "NOVA" and "NOVA ScienceNOW" added to Renamer, and it seems to have trouble with this since "NOVA ScienceNOW" starts with "NOVA", the name of another show. In this case, I get a new episode of "NOVA ScienceNOW" downloaded and TVR wants to rename it as "NOVA" - I suspect it's because it sees the filename:

NOVA ScienceNOW.s05e01.Making.Diamonds.mkv

And sees that it starts with "NOVA" followed by some junk, and it contains an episode number that I missing. I haven't dug into the code, which I intend to do to see if there's an easy fix, but I'll bet it doesn't even get to "NOVA ScienceNOW" to check if it's a better match, because it's already flagged it as a missing episode of NOVA.

Here's my proposed solution, and one I'm happy to modify the code and submit with some other enhancements I'm considering - when checking for missing episodes, run the list of shows backwards instead of forwards. Since this would only happen where "SHOW A" shares part of the name of "SHOW AB", then running through the show list forwards results in an episode of "SHOW AB" being flagged as "SHOW A". If the list was run in reverse order, the longer show name ("SHOW AB") would be checked first, and it would correctly register the new file as an episode of the show with the longer name. I can't think of any side-effects this might have, though if I'm going to code it and anybody can think of a side-effect, please share it so I can take that into consideration.