Commit af7bbac7 authored by Dustyn Gibson's avatar Dustyn Gibson
Browse files

Log regex mode only on error, disable unnecessary pp messages

parent 6b816adf
......@@ -78,13 +78,13 @@ class NameParser(object):
def _compile_regexes(self, regexMode):
if regexMode == self.ANIME_REGEX:
logger.log(u"Using ANIME regexs", logger.DEBUG)
dbg_str = u"ANIME"
uncompiled_regex = [regexes.anime_regexes, regexes.normal_regexes]
elif regexMode == self.NORMAL_REGEX:
logger.log(u"Using NORMAL regexs", logger.DEBUG)
dbg_str = u"NORMAL"
uncompiled_regex = [regexes.normal_regexes]
else:
logger.log(u"Using ALL regexes", logger.DEBUG)
dbg_str = u"ALL"
uncompiled_regex = [regexes.normal_regexes, regexes.anime_regexes]
self.compiled_regexes = []
......@@ -93,7 +93,7 @@ class NameParser(object):
try:
cur_regex = re.compile(cur_pattern, re.VERBOSE | re.IGNORECASE)
except re.error, errormsg:
logger.log(u"WARNING: Invalid episode_pattern, %s. %s" % (errormsg, cur_pattern))
logger.log(u"WARNING: Invalid episode_pattern using %s regexs, %s. %s" % (dbg_str, errormsg, cur_pattern))
else:
self.compiled_regexes.append((cur_pattern_num, cur_pattern_name, cur_regex))
......@@ -607,4 +607,4 @@ class InvalidNameException(Exception):
class InvalidShowException(Exception):
"The given show name is not valid"
\ No newline at end of file
"The given show name is not valid"
......@@ -444,8 +444,7 @@ def already_postprocessed(dirName, videofile, force, result):
myDB = db.DBConnection()
sqlResult = myDB.select("SELECT * FROM tv_episodes WHERE release_name = ?", [dirName])
if sqlResult:
result.output += logHelper(u"You're trying to post process a dir that's already been processed, skipping",
logger.DEBUG)
#result.output += logHelper(u"You're trying to post process a dir that's already been processed, skipping", logger.DEBUG)
return True
else:
......@@ -455,8 +454,7 @@ def already_postprocessed(dirName, videofile, force, result):
sqlResult = myDB.select("SELECT * FROM tv_episodes WHERE release_name = ?", [videofile.rpartition('.')[0]])
if sqlResult:
result.output += logHelper(u"You're trying to post process a video that's already been processed, skipping",
logger.DEBUG)
#result.output += logHelper(u"You're trying to post process a video that's already been processed, skipping", logger.DEBUG)
return True
#Needed if we have downloaded the same episode @ different quality
......@@ -479,8 +477,7 @@ def already_postprocessed(dirName, videofile, force, result):
search_sql += " and history.resource LIKE ?"
sqlResult = myDB.select(search_sql, [u'%' + videofile])
if sqlResult:
result.output += logHelper(u"You're trying to post process a video that's already been processed, skipping",
logger.DEBUG)
#result.output += logHelper(u"You're trying to post process a video that's already been processed, skipping", logger.DEBUG)
return True
return False
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment