From b20449803d8d11320d629b43c2f1633ae993e2e8 Mon Sep 17 00:00:00 2001 From: evilhero Date: Fri, 30 May 2014 14:10:46 -0400 Subject: [PATCH] FIX:(#721) post-processing would succeed, but exit code returned in sabnzbd, FIX:(#716) If series in watchlist has decimals in title, will check match against filename before proceeding further during post-processing (this could be an on-going type of fix that's needed) --- mylar/filechecker.py | 6 +++++- mylar/webserve.py | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/mylar/filechecker.py b/mylar/filechecker.py index c059fe9d..f1104bb4 100755 --- a/mylar/filechecker.py +++ b/mylar/filechecker.py @@ -172,6 +172,10 @@ def listFiles(dir,watchcomic,Publisher,AlternateSearch=None,manual=None,sarc=Non subthis = re.sub('.cbz', '', subthis) subthis = re.sub('[\:\;\!\'\/\?\+\=\_\%\.]', '', subthis) logger.fdebug('[FILECHECKER] sub-cleaned: ' + str(subthis)) + #we need to make sure the file is part of the correct series or else will match falsely + if watchname not in subthis: + logger.fdebug('[FILECHECKER] this is a false match. Ignoring this result.') + continue subthis = subthis[len(watchname):] #remove watchcomic #we need to now check the remainder of the string for digits assuming it's a possible year logger.fdebug('[FILECHECKER] new subname: ' + str(subthis)) @@ -351,7 +355,7 @@ def listFiles(dir,watchcomic,Publisher,AlternateSearch=None,manual=None,sarc=Non #same = encode. u_altsearchcomic = AS_Alternate.encode('ascii', 'ignore').strip() altsearchcomic = re.sub('[\_\#\,\/\:\;\.\!\$\%\+\'\?\@]', ' ', u_altsearchcomic) - altsearchcomic = re.sub('[\-]', '', altsearchcomic) + altsearchcomic = re.sub('[\-]', ' ', altsearchcomic) #because this is a watchcomic registered, use same algorithim for watchcomic altsearchcomic = re.sub('\&', ' and ', altsearchcomic) altsearchcomic = re.sub('\s+', ' ', str(altsearchcomic)).strip() AS_Alt.append(altsearchcomic) diff --git a/mylar/webserve.py b/mylar/webserve.py index 0177d915..1904a7c2 100755 --- a/mylar/webserve.py +++ b/mylar/webserve.py @@ -474,7 +474,7 @@ class WebInterface(object): threading.Thread(target=PostProcess.Process).start() raise cherrypy.HTTPRedirect("home") else: - result = threading.Thread(target=PostProcess.Process).start() + result = PostProcess.Process() return result #log2screen = threading.Thread(target=PostProcessor.PostProcess, args=[nzb_name,nzb_folder]).start() #return serve_template(templatename="postprocess.html", title="postprocess")