diff --git a/gui/slick/interfaces/default/displayShow.tmpl b/gui/slick/interfaces/default/displayShow.tmpl index 3a8a77b3..00bc0432 100644 --- a/gui/slick/interfaces/default/displayShow.tmpl +++ b/gui/slick/interfaces/default/displayShow.tmpl @@ -189,8 +189,25 @@ Replace with: <%=", ".join([Quality.qualityStrings[x] for x in sorted(bestQualities)])%> #end if #end if - Scene Name:#if $show.exceptions then $exceptions_string else $show.name# +#if $show.rls_require_words: + Required Words: #echo $show.rls_require_words# +#end if +#if $show.rls_ignore_words: + Ignored Words: #echo $show.rls_ignore_words# +#end if +#if $bwl.get_white_keywords_for("release_group"): + + Wanted Group#if len($bwl.get_white_keywords_for("release_group"))>1 then "s" else ""#: + #echo ', '.join($bwl.get_white_keywords_for("release_group"))# + +#end if +#if $bwl.get_black_keywords_for("release_group"): + + Unwanted Group#if len($bwl.get_black_keywords_for("release_group"))>1 then "s" else ""#: + #echo ', '.join($bwl.get_black_keywords_for("release_group"))# + +#end if @@ -209,25 +226,6 @@ #if $anyQualities + $bestQualities Archive First Match: \"Y" #end if - -#if $bwl.get_white_keywords_for("gloabl"): - Whitelist: #echo ', '.join($bwl.get_white_keywords_for("gloabl"))# -#end if -#if $bwl.get_black_keywords_for("gloabl"): - Blacklist: #echo ', '.join($bwl.get_black_keywords_for("gloabl"))# -#end if -#if $bwl.get_white_keywords_for("release_group"): - - Wanted Group#if len($bwl.get_white_keywords_for("release_group"))>1 then "s" else ""#: - #echo ', '.join($bwl.get_white_keywords_for("release_group"))# - -#end if -#if $bwl.get_black_keywords_for("release_group"): - - Unwanted Group#if len($bwl.get_black_keywords_for("release_group"))>1 then "s" else ""#: - #echo ', '.join($bwl.get_black_keywords_for("release_group"))# - -#end if diff --git a/gui/slick/interfaces/default/history.tmpl b/gui/slick/interfaces/default/history.tmpl index 802f5cf4..2742e969 100644 --- a/gui/slick/interfaces/default/history.tmpl +++ b/gui/slick/interfaces/default/history.tmpl @@ -119,16 +119,8 @@ #if $curStatus == DOWNLOADED: - #set $match = $re.search("\-(\w+)\.\w{3}\Z", $os.path.basename($hItem["resource"])) - #if $match - #if $match.group(1).upper() in ("X264", "720P"): - #set $match = $re.search("(\w+)\-.*\-"+$match.group(1)+"\.\w{3}\Z", $os.path.basename($hItem["resource"]), re.IGNORECASE) - #if $match - $match.group(1).upper() - #end if - #else: - $match.group(1).upper() - #end if + #if $hItem["provider"] != "-1": + $hItem["provider"] #end if #else #if $hItem["provider"] > 0 diff --git a/sickbeard/name_parser/parser.py b/sickbeard/name_parser/parser.py index bb0250ab..74f163a8 100644 --- a/sickbeard/name_parser/parser.py +++ b/sickbeard/name_parser/parser.py @@ -109,29 +109,32 @@ class NameParser(object): logger.log(u"WARNING: Invalid show series name pattern, %s: [%s]" % (errormsg, pattern)) else: # attempt matching with main show name pattern - seriesname_match = show_regex.match(name) - if seriesname_match: - seriesname_groups = seriesname_match.groupdict().keys() - if 'series_name' in seriesname_groups: - series_name = self.clean_series_name(seriesname_match.group('series_name')) + showname_match = show_regex.match(name) + if showname_match: + showname_groups = showname_match.groupdict().keys() + if 'show_name' in showname_groups: + series_name = self.clean_series_name(showname_match.group('show_name')) return helpers.get_show_by_name(series_name, useIndexer=self.useIndexers) def _parse_string(self, name): if not name: return - self.showObj = None - if not self.naming_pattern: + if not self.showObj and not self.naming_pattern: # Regex pattern to return the Show / Series Name regardless of the file pattern tossed at it, matched 53 show name examples from regexes.py - show_pattern = '''(?:(?:\[.*?\])|(?:\d{3}[\.-]))*[ _\.]?(?P.*?(?:[ ._-]((?!\d{4}\W\d\d\W\d\d\W)\d{4}))?)(?:(?:(?:[ ._-]+\d+)|(?:[ ._-]+s\d{2}))|(?:\W+(?:(?:S\d[\dE._ -])|(?:\d\d?x)|(?:\d{4}\W\d\d\W\d\d)|(?:(?:part|pt)[\._ -]?(?:\d|[ivx]))|Season\W+\d+\W+|E\d+\W+|(?:\d{1,3}.+\d{1,}[a-zA-Z]{2}\W+[a-zA-Z]{3,}\W+\d{4}.+))))''' - show_pattern_alt = '''^(?P.*?(?:[ ._-]((?!\d{4}\W\d\d\W\d\d\W)\d{4}))?)(?:(?:(?:[ ._-]+\d+)|(?:[ ._-]+s\d{2}))|(?:\W+(?:(?:S\d[\dE._ -])|(?:\d\d?x)|(?:\d{4}\W\d\d\W\d\d)|(?:(?:part|pt)[\._ -]?(?:\d|[ivx]))|Season\W+\d+\W+|E\d+\W+|(?:\d{1,3}.+\d{1,}[a-zA-Z]{2}\W+[a-zA-Z]{3,}\W+\d{4}.+))))''' + show_patterns = [ + '''^(?P.*?)\W+(?:(?:S\d[\dE._ -])|(?:\d\d?x)|(?:\d{4}\W\d\d\W\d\d)|(?:(?:part|pt)[\._ -]?(\d|[ivx]))|Season\W+\d+\W+|E\d+\W+|(?:\d{1,3}.+\d{1,}[a-zA-Z]{2}\W+[a-zA-Z]{3,}\W+\d{4}.+))''', + '''^((\[.*?\])|(\d+[\.-]))*[ _\.]*(?P.*?)(([ ._-]+\d+)|([ ._-]+s\d{2})).*''' + ] - self.showObj = self._matchShowName(name, show_pattern) - if not self.showObj: - self.showObj = self._matchShowName(name, show_pattern_alt) - - if not self.showObj: - raise InvalidShowException("Unable to parse " + name.encode(sickbeard.SYS_ENCODING, 'xmlcharrefreplace')) + # find show object + for pattern in show_patterns: + self.showObj = self._matchShowName(name, pattern) + if self.showObj: + break + else: + raise InvalidShowException( + "Unable to parse " + name.encode(sickbeard.SYS_ENCODING, 'xmlcharrefreplace')) regexMode = self.ALL_REGEX if self.showObj and self.showObj.is_anime: diff --git a/sickbeard/postProcessor.py b/sickbeard/postProcessor.py index c90518b3..3f2ac4b1 100644 --- a/sickbeard/postProcessor.py +++ b/sickbeard/postProcessor.py @@ -480,12 +480,11 @@ class PostProcessor(object): return to_return # parse the name to break it into show name, season, and episode - try: - np = NameParser(file, useIndexers=True, convert=True) - parse_result = np.parse(name) - except InvalidShowException: - logger.log(u"Unable to parse the filename " + name + " into a valid show", logger.WARNING) - return to_return + np = NameParser(file, useIndexers=True, convert=True) + parse_result = np.parse(name) + + # show object + show = parse_result.show if parse_result.air_by_date: season = -1 @@ -497,7 +496,7 @@ class PostProcessor(object): season = parse_result.season_number episodes = parse_result.episode_numbers - to_return = (parse_result.show, season, episodes, parse_result.quality) + to_return = (show, season, episodes, parse_result.quality) self._finalize(parse_result) return to_return @@ -603,7 +602,7 @@ class PostProcessor(object): try: (cur_show, cur_season, cur_episodes, cur_quality) = cur_attempt() - except InvalidNameException, e: + except (InvalidNameException, InvalidShowException), e: logger.log(u"Unable to parse, skipping: " + ex(e), logger.DEBUG) continue diff --git a/sickbeard/tv.py b/sickbeard/tv.py index 3b6ee39c..3b9beb32 100644 --- a/sickbeard/tv.py +++ b/sickbeard/tv.py @@ -618,11 +618,14 @@ class TVShow(object): logger.log(str(self.indexerid) + u": Creating episode object from " + file, logger.DEBUG) try: - myParser = NameParser(showObj=self, useIndexers=True) + myParser = NameParser(True, showObj=self, useIndexers=True) parse_result = myParser.parse(file) except InvalidNameException: logger.log(u"Unable to parse the filename " + file + " into a valid episode", logger.ERROR) return None + except InvalidShowException: + logger.log(u"Unable to parse the filename " + file + " into a valid show", logger.WARNING) + return None if not len(parse_result.episode_numbers) and not (parse_result.air_by_date or parse_result.sports): logger.log("parse_result: " + str(parse_result))