diff --git a/sickbeard/name_parser/regexes.py b/sickbeard/name_parser/regexes.py index fb1de508..38778a12 100644 --- a/sickbeard/name_parser/regexes.py +++ b/sickbeard/name_parser/regexes.py @@ -194,7 +194,7 @@ sports_regexs = [ ''' ^(?P(UEFA|MLB|ESPN|WWE|MMA|UFC|TNA|EPL|NASCAR|NBA|NFL|NHL|NRL|PGA|SUPER LEAGUE|FORMULA|FIFA|NETBALL|MOTOGP))[. _-]+ ((?P\d{3})[. _-]+)? - ((?P\w+)[. _-]+)? + ((?P\.+)[. _-]+)? (?P(\d{4}[. _-]+\d{1,2}[. _-]+\d{1,2})|(\d{1,2}\w{2}[. _-]+\w+[. _-]+\d{4})) [. _-]*((?P.+?)((?[^- ]+))?)?$ diff --git a/sickbeard/postProcessor.py b/sickbeard/postProcessor.py index 20aad248..ea6cacb8 100644 --- a/sickbeard/postProcessor.py +++ b/sickbeard/postProcessor.py @@ -486,7 +486,7 @@ class PostProcessor(object): np = NameParser(file) parse_result = np.parse(name) - self._log("Parsed " + name + " into " + str(parse_result).decode('utf-8'), logger.DEBUG) + self._log(u"Parsed " + name + " into " + str(parse_result).decode('utf-8', 'xmlcharrefreplace'), logger.DEBUG) if parse_result.air_by_date: season = -1 @@ -915,6 +915,7 @@ class PostProcessor(object): # find the destination folder try: proper_path = ep_obj.proper_path() + test = proper_path proper_absolute_path = ek.ek(os.path.join, ep_obj.show.location, proper_path) dest_path = ek.ek(os.path.dirname, proper_absolute_path) diff --git a/sickbeard/tv.py b/sickbeard/tv.py index 77c02d4f..34153684 100644 --- a/sickbeard/tv.py +++ b/sickbeard/tv.py @@ -2055,10 +2055,13 @@ class TVEpisode(object): else: pattern = sickbeard.NAMING_PATTERN - # split off the filename only, if they exist + # split off the dirs only, if they exist name_groups = re.split(r'[\\/]', pattern) - return self._format_pattern(name_groups[-1], multi) + if len(name_groups) == 1: + return '' + else: + return self._format_pattern(os.sep.join(name_groups[:-1]), multi) def rename(self): """