Incorrect metadata when show name has brackets e.g. "Castle (2009)"

“Castle (2009) - 1x01 - Flowers for Your Grave.avi” is being incorrectly parsed as “Castle S20E09” (the year is being read as season+episode number). This means I see generic information about a show about historical castles, rather that the correct synopses.

Worse still, I can’t select alternate metadata as I assume it’s searching for shows containing the whole “Castle (2009)” string, which matches nothing else :frowning:

I know I could rename the folders and filenames to fix this problem, but would prefer not to get the info out of sync to how TheTVDb and Sickbeard have it set up.

We’ll take a look and see if we can get this resolved.

I would like to mod this one up… thetvdb.com routinely uses the year first aired to disambiguate tv shows that otherwise have the same name. For example:

Jericho (2006) - “Jericho” by itself does return the correct show now, but it used to return the 1966 series.

Battlestar Galactica (2003) - Without the year the 1978 series is returned.

Merlin (2008) - This one is really bad, as there is no english show indexed with just the name “Merlin”, so if you don’t use the year you get back “Merlin the Magical Puppy” which isn’t even remotely close…

There are hundreds of shows like this so this is a significant bug. All of these cause FireCore MP to either fail or return the wrong tv show.

I’m not sure how the code that scraps the filenames looks so I cant comment on absolute best way to fix this using a generalized regex - but something along these lines might work (assuming all periods and underscores are replaced with whitespace prior to analysis - if you normalize these aftewards you would need to write this differently)

^(.)\s(?:S|SE|Season)?(\d{1,2})\s?(?:\s|X|x|E|EP|Episode)?(\d{1,3}).$

Group 1 would be the show name, Group 2 would be the season, and Group 3 would be the episode number. This won’t trip up on the year as long as it comes before the season/episode info. I think this regex would still match on all of your current supported naming conventions as listed in the FAQ.

Another show that this happens with is “Once upon a time” I’d really like to include the year somehow to clarify which show it is.

I find that using a name of the form:

Once.upon.a.time.2011.S01E01.episode name

gives the correct show. A similar format for other shows where the year is important also works.