mirror of
https://github.com/evilhero/mylar
synced 2025-02-02 04:21:43 +00:00
FIX: When manual post-processing if filename didn't have a volume label, or a valid year - would error out, IMP: Added additional date recognition fornat of (YYYYMM)
This commit is contained in:
parent
0f6f3792b7
commit
93077a0532
2 changed files with 8 additions and 5 deletions
|
@ -391,6 +391,13 @@ class PostProcessor(object):
|
|||
continue
|
||||
else:
|
||||
datematch = "True"
|
||||
if issuechk['ReleaseDate'] is not None and issuechk['ReleaseDate'] != '0000-00-00':
|
||||
monthval = issuechk['ReleaseDate']
|
||||
watch_issueyear = issuechk['ReleaseDate'][:4]
|
||||
else:
|
||||
monthval = issuechk['IssueDate']
|
||||
watch_issueyear = issuechk['IssueDate'][:4]
|
||||
|
||||
if len(watchmatch) >= 1 and watchmatch['issue_year'] is not None:
|
||||
#if the # of matches is more than 1, we need to make sure we get the right series
|
||||
#compare the ReleaseDate for the issue, to the found issue date in the filename.
|
||||
|
@ -404,14 +411,10 @@ class PostProcessor(object):
|
|||
#logger.info(module + ' ReleaseDate: ' + str(issuechk['ReleaseDate']))
|
||||
#logger.info(module + ' IssueDate: ' + str(issuechk['IssueDate']))
|
||||
if issuechk['ReleaseDate'] is not None and issuechk['ReleaseDate'] != '0000-00-00':
|
||||
monthval = issuechk['ReleaseDate']
|
||||
watch_issueyear = issuechk['ReleaseDate'][:4]
|
||||
if int(issuechk['ReleaseDate'][:4]) < int(watchmatch['issue_year']):
|
||||
logger.fdebug(module + '[ISSUE-VERIFY] ' + str(issuechk['ReleaseDate']) + ' is before the issue year of ' + str(watchmatch['issue_year']) + ' that was discovered in the filename')
|
||||
datematch = "False"
|
||||
else:
|
||||
monthval = issuechk['IssueDate']
|
||||
watch_issueyear = issuechk['IssueDate'][:4]
|
||||
if int(issuechk['IssueDate'][:4]) < int(watchmatch['issue_year']):
|
||||
logger.fdebug(module + '[ISSUE-VERIFY] ' + str(issuechk['IssueDate']) + ' is before the issue year ' + str(watchmatch['issue_year']) + ' that was discovered in the filename')
|
||||
datematch = "False"
|
||||
|
|
|
@ -1077,7 +1077,7 @@ class FileChecker(object):
|
|||
# Jan 1990
|
||||
# January1990'''
|
||||
|
||||
fmts = ('%Y','%b %d, %Y','%b %d, %Y','%B %d, %Y','%B %d %Y','%m/%d/%Y','%m/%d/%y','%b %Y','%B%Y','%b %d,%Y','%m-%Y','%B %Y','%Y-%m-%d','%Y-%m')
|
||||
fmts = ('%Y','%b %d, %Y','%B %d, %Y','%B %d %Y','%m/%d/%Y','%m/%d/%y','%b %Y','%B%Y','%b %d,%Y','%m-%Y','%B %Y','%Y-%m-%d','%Y-%m','%Y%m')
|
||||
|
||||
parsed=[]
|
||||
for e in txt.splitlines():
|
||||
|
|
Loading…
Reference in a new issue