1
0
Fork 0
mirror of https://github.com/evilhero/mylar synced 2024-12-24 08:42:37 +00:00

FIX:(#707) Updated PP if src & dst were identical during rename call

This commit is contained in:
evilhero 2014-05-26 14:32:44 -04:00
parent e00d6c5ddf
commit 46f658d6b6
2 changed files with 10 additions and 6 deletions

View file

@ -241,8 +241,8 @@ class PostProcessor(object):
#if ReleaseDate doesn't exist, use IssueDate
#if no issue date was found, then ignore.
issyr = None
logger.fdebug('issuedate:' + str(issuechk['IssueDate']))
logger.fdebug('issuechk: ' + str(issuechk['IssueDate'][5:7]))
#logger.fdebug('issuedate:' + str(issuechk['IssueDate']))
#logger.fdebug('issuechk: ' + str(issuechk['IssueDate'][5:7]))
#logger.info('ReleaseDate: ' + str(issuechk['ReleaseDate']))
#logger.info('IssueDate: ' + str(issuechk['IssueDate']))
@ -788,8 +788,12 @@ class PostProcessor(object):
#downtype = for use with updater on history table to set status to 'Post-Processed'
downtype = 'PP'
#Manual Run, this is the portion.
logger.fdebug("Renaming " + os.path.join(self.nzb_folder, str(ofilename)) + " ..to.. " + os.path.join(self.nzb_folder,str(nfilename + ext)))
os.rename(os.path.join(self.nzb_folder, str(ofilename)), os.path.join(self.nzb_folder,str(nfilename + ext)))
if mylar.RENAME_FILES:
if str(ofilename) != str(nfilename + ext):
logger.fdebug("Renaming " + os.path.join(self.nzb_folder, str(ofilename)) + " ..to.. " + os.path.join(self.nzb_folder,str(nfilename + ext)))
os.rename(os.path.join(self.nzb_folder, str(ofilename)), os.path.join(self.nzb_folder,str(nfilename + ext)))
else:
logger.fdebug('filename is identical as original, not renaming.')
src = os.path.join(self.nzb_folder, str(nfilename + ext))
logger.fdebug("Moving " + src + " ... to ... " + dst)
try:

View file

@ -226,8 +226,8 @@ def listFiles(dir,watchcomic,Publisher,AlternateSearch=None,manual=None,sarc=Non
#and adds to the subname. (Cases where comic name is $Series_$Year_$Issue)
if len(subnm) > 1:
if (re.search('(19\d{2}|20\d{2})',subnm[1]) is not None):
logger.fdebug('subnm0: ' + str(subnm[0]))
logger.fdebug('subnm1: ' + str(subnm[1]))
logger.fdebug('[FILECHECKER] subnm0: ' + str(subnm[0]))
logger.fdebug('[FILECHECKER] subnm1: ' + str(subnm[1]))
# logger.fdebug('subnm2: ' + str(subnm[2]))
subname = str(subnm[0]).lstrip() + ' (' + str(subnm[1]).strip() + ') '
subnm = re.findall('[^()]+', subname) # we need to regenerate this here.