mirror of
https://github.com/evilhero/mylar
synced 2025-02-21 21:46:54 +00:00
FIX:(#1796) When renaming issues, if issue number was not a non-padded number and annuals were enabled would not return valid results, FIX: (#1796) When searching against CV with multiple common terms, would improperly remove characters without adjusting for previous changes
This commit is contained in:
parent
6f133be1ef
commit
b29a732f28
2 changed files with 13 additions and 13 deletions
|
@ -291,9 +291,8 @@ def rename_param(comicid, comicname, issue, ofilename, comicyear=None, issueid=N
|
|||
#this has to be adjusted to be able to include story arc issues that span multiple arcs
|
||||
chkissue = myDB.selectone("SELECT * from readinglist WHERE ComicID=? AND Issue_Number=?", [comicid, issue]).fetchone()
|
||||
else:
|
||||
if all([annualize is None, not mylar.CONFIG.ANNUALS_ON]):
|
||||
chkissue = myDB.selectone("SELECT * from issues WHERE ComicID=? AND Issue_Number=?", [comicid, issue]).fetchone()
|
||||
else:
|
||||
chkissue = myDB.selectone("SELECT * from issues WHERE ComicID=? AND Issue_Number=?", [comicid, issue]).fetchone()
|
||||
if all([chkissue is None, annualize is None, not mylar.CONFIG.ANNUALS_ON]):
|
||||
chkissue = myDB.selectone("SELECT * from annuals WHERE ComicID=? AND Issue_Number=?", [comicid, issue]).fetchone()
|
||||
|
||||
if chkissue is None:
|
||||
|
@ -302,7 +301,7 @@ def rename_param(comicid, comicname, issue, ofilename, comicyear=None, issueid=N
|
|||
chkissue = myDB.selectone("SELECT * from readinglist WHERE ComicID=? AND Int_IssueNumber=?", [comicid, issuedigits(issue)]).fetchone()
|
||||
else:
|
||||
chkissue = myDB.selectone("SELECT * from issues WHERE ComicID=? AND Int_IssueNumber=?", [comicid, issuedigits(issue)]).fetchone()
|
||||
if all([annualize == 'yes', mylar.CONFIG.ANNUALS_ON]):
|
||||
if all([chkissue is None, annualize == 'yes', mylar.CONFIG.ANNUALS_ON]):
|
||||
chkissue = myDB.selectone("SELECT * from annuals WHERE ComicID=? AND Int_IssueNumber=?", [comicid, issuedigits(issue)]).fetchone()
|
||||
|
||||
if chkissue is None:
|
||||
|
|
19
mylar/mb.py
19
mylar/mb.py
|
@ -87,15 +87,16 @@ def findComic(name, mode, issue, limityear=None, type=None):
|
|||
|
||||
commons = ['and', 'the', '&', '-']
|
||||
for x in commons:
|
||||
if x in name.lower():
|
||||
for m in re.finditer(x, name.lower()):
|
||||
tehstart = m.start()
|
||||
tehend = m.end()
|
||||
if any([x == 'the', x == 'and']):
|
||||
if not all([tehstart == 0, name[tehend] == ' ']) or not all([tehstart != 0, name[tehstart-1] == ' ', name[tehend] == ' ']):
|
||||
continue
|
||||
else:
|
||||
name = name[tehstart:tehend].replace(x, ' ').strip() + name[tehend+1:]
|
||||
cnt = 0
|
||||
for m in re.finditer(x, name.lower()):
|
||||
cnt +=1
|
||||
tehstart = m.start()
|
||||
tehend = m.end()
|
||||
if any([x == 'the', x == 'and']):
|
||||
if not all([tehstart == 0, name[tehend] == ' ']) or not all([tehstart != 0, name[tehstart-1] == ' ', name[tehend] == ' ']):
|
||||
continue
|
||||
else:
|
||||
name = name.replace(x, ' ', cnt)
|
||||
|
||||
pattern = re.compile(ur'\w+', re.UNICODE)
|
||||
name = pattern.findall(name)
|
||||
|
|
Loading…
Reference in a new issue