FIX:(#511) When searching, if issue # contained alpha seperate from issue would not match, FIX: improved file checking for Manual Run Post-Processing

This commit is contained in:
evilhero 2013-08-17 13:54:41 -04:00
parent c151f8eb05
commit 2e2ac37b7c
4 changed files with 47 additions and 36 deletions

View File

@ -189,7 +189,7 @@ class PostProcessor(object):
ccnt=0
nm=0
for cs in comicseries:
watchmatch = filechecker.listFiles(self.nzb_folder,cs['ComicName'],cs['AlternateSearch'])
watchmatch = filechecker.listFiles(self.nzb_folder,cs['ComicName'],cs['AlternateSearch'], manual="yes")
if watchmatch is None:
nm+=1
pass
@ -434,6 +434,7 @@ class PostProcessor(object):
issueid = ml['IssueID']
issuenumOG = ml['IssueNumber']
self.Process_next(comicid,issueid,issuenumOG,ml)
return
else:
comicid = issuenzb['ComicID']
issuenumOG = issuenzb['Issue_Number']
@ -724,18 +725,19 @@ class PostProcessor(object):
try:
shutil.move(src, dst)
except (OSError, IOError):
self._log("Failed to move directory - check directories and manually re-run.", logger.DEBUG)
self._log("Post-Processing ABORTED.", logger.DEBUG)
logger.fdebug("Failed to move directory - check directories and manually re-run.")
logger.fdebug("Post-Processing ABORTED.")
return
logger.fdebug("Successfully moved to : " + dst)
#tidyup old path
try:
os.remove(os.path.join(self.nzb_folder, str(ofilename)))
logger.fdebug("Deleting : " + os.path.join(self.nzb_folder, str(ofilename)))
except (OSError, IOError):
self._log("Failed to remove temporary directory - check directory and manually re-run.", logger.DEBUG)
self._log("Post-Processing ABORTED.", logger.DEBUG)
return
self._log("Removed temporary directory : " + str(self.nzb_folder), logger.DEBUG)
#try:
# os.remove(os.path.join(self.nzb_folder, str(ofilename)))
# logger.fdebug("Deleting : " + os.path.join(self.nzb_folder, str(ofilename)))
#except (OSError, IOError):
# logger.fdebug("Failed to remove temporary directory - check directory and manually re-run.")
# logger.fdebug("Post-Processing ABORTED.")
# return
#logger.fdebug("Removed temporary directory : " + str(self.nzb_folder))
#delete entry from nzblog table
myDB.action('DELETE from nzblog WHERE issueid=?', [issueid])
@ -748,22 +750,24 @@ class PostProcessor(object):
updater.forceRescan(comicid)
logger.info(u"Post-Processing completed for: " + series + " issue: " + str(issuenumOG) )
self._log(u"Post Processing SUCCESSFULL! ", logger.DEBUG)
if ml is not None:
return
else:
if mylar.PROWL_ENABLED:
pushmessage = series + '(' + issueyear + ') - issue #' + issuenumOG
logger.info(u"Prowl request")
prowl = notifiers.PROWL()
prowl.notify(pushmessage,"Download and Postprocessing completed")
if mylar.NMA_ENABLED:
nma = notifiers.NMA()
nma.notify(series, str(issueyear), str(issuenumOG))
if mylar.PROWL_ENABLED:
pushmessage = series + '(' + issueyear + ') - issue #' + issuenumOG
logger.info(u"Prowl request")
prowl = notifiers.PROWL()
prowl.notify(pushmessage,"Download and Postprocessing completed")
if mylar.NMA_ENABLED:
nma = notifiers.NMA()
nma.notify(series, str(issueyear), str(issuenumOG))
if mylar.PUSHOVER_ENABLED:
pushmessage = series + ' (' + str(issueyear) + ') - issue #' + str(issuenumOG)
logger.info(u"Pushover request")
pushover = notifiers.PUSHOVER()
pushover.notify(pushmessage, "Download and Post-Processing completed")
if mylar.PUSHOVER_ENABLED:
pushmessage = series + ' (' + str(issueyear) + ') - issue #' + str(issuenumOG)
logger.info(u"Pushover request")
pushover = notifiers.PUSHOVER()
pushover.notify(pushmessage, "Download and Post-Processing completed")
# retrieve/create the corresponding comic objects

View File

@ -28,7 +28,6 @@ def file2comicmatch(watchmatch):
pass
def listFiles(dir,watchcomic,AlternateSearch=None,manual=None):
manual = "no"
# use AlternateSearch to check for filenames that follow that naming pattern
# ie. Star Trek TNG Doctor Who Assimilation won't get hits as the

View File

@ -491,11 +491,12 @@ def NZB_SEARCH(ComicName, IssueNumber, ComicYear, SeriesYear, nzbprov, nzbpr, Is
#CBT is redudant now since only RSS works
# - just getting it ready for when it's not redudant :)
if nzbprov == 'ComicBT':
cmname = re.sub("%20", " ", str(comsrc))
logger.fdebug("Sending request to [ComicBT] RSS for " + str(cmname) + " : " + str(mod_isssearch))
bb = rsscheck.torrentdbsearch(cmname,mod_isssearch,ComicID)
rss = "yes"
if bb is not None: logger.fdebug("results: " + str(bb))
# cmname = re.sub("%20", " ", str(comsrc))
# logger.fdebug("Sending request to [ComicBT] RSS for " + str(cmname) + " : " + str(mod_isssearch))
# bb = rsscheck.torrentdbsearch(cmname,mod_isssearch,ComicID)
# rss = "yes"
# if bb is not None: logger.fdebug("results: " + str(bb))
bb = "no results"
elif nzbprov == 'KAT':
cmname = re.sub("%20", " ", str(comsrc))
logger.fdebug("Sending request to [KAT] for " + str(cmname) + " : " + str(mod_isssearch))
@ -808,8 +809,13 @@ def NZB_SEARCH(ComicName, IssueNumber, ComicYear, SeriesYear, nzbprov, nzbpr, Is
logger.fdebug("invalid naming format of nzb detected - cannot properly determine issue")
continue
else:
comic_iss = tmpiss
splitst = len(splitit) - 1
if a_issno == '' and alphas is not None:
#if there' a space between the issue & alpha, join them.
comic_iss = splitit[(len(splitit)-2)] + splitit[(len(splitit)-1)]
splitst = len(splitit) - 2
else:
comic_iss = tmpiss
splitst = len(splitit) - 1
logger.fdebug("adjusting from: " + str(comic_iss_b4) + " to: " + str(comic_iss))
#bmm = re.findall('v\d', comic_iss)
#if len(bmm) > 0: splitst = len(splitit) - 2

View File

@ -370,10 +370,12 @@ class WebInterface(object):
PostProcess = PostProcessor.PostProcessor(nzb_name, nzb_folder)
result = PostProcess.Process()
#result = post_results.replace("\n","<br />\n")
return result
if nzb_name == 'Manual Run' or nzb_name == 'Manual+Run':
raise cherrypy.HTTPRedirect("home")
else:
return result
#log2screen = threading.Thread(target=PostProcessor.PostProcess, args=[nzb_name,nzb_folder]).start()
#return serve_template(templatename="postprocess.html", title="postprocess")
#raise cherrypy.HTTPRedirect("comicDetails?ComicID=%s" % comicid)
post_process.exposed = True
def pauseArtist(self, ComicID):