From 4d1b61846b5e2d8021a237edf715d211d5b7f884 Mon Sep 17 00:00:00 2001 From: evilhero Date: Thu, 24 Jan 2013 13:31:03 -0500 Subject: [PATCH] FIX: comics that had alot of issues would take forever to initially add (improved speed performance). --- mylar/parseit.py | 7 +++++-- mylar/webserve.py | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/mylar/parseit.py b/mylar/parseit.py index 7899d919..2971039e 100755 --- a/mylar/parseit.py +++ b/mylar/parseit.py @@ -23,7 +23,7 @@ import datetime from decimal import Decimal from HTMLParser import HTMLParseError -def GCDScraper(ComicName, ComicYear, Total, ComicID): +def GCDScraper(ComicName, ComicYear, Total, ComicID, quickmatch=None): NOWyr = datetime.date.today().year if datetime.date.today().month == 12: NOWyr = NOWyr + 1 @@ -148,8 +148,11 @@ def GCDScraper(ComicName, ComicYear, Total, ComicID): if 'and' in ComicName.lower(): ComicName = ComicName.replace('and', '&') return GCDScraper(ComicName, ComicYear, Total, ComicID) - return 'No Match' + if not quickmatch: return 'No Match' #vari_loop = 0 + if quickmatch == "yes": + if resultURL is None: return 'No Match' + else: return 'Match' return GCDdetails(comseries=None, resultURL=resultURL, vari_loop=0, ComicID=ComicID, TotalIssues=TotalIssues, issvariation=issvariation, resultPublished=resultPublished) diff --git a/mylar/webserve.py b/mylar/webserve.py index 6ab5a831..92dda2ec 100755 --- a/mylar/webserve.py +++ b/mylar/webserve.py @@ -115,7 +115,7 @@ class WebInterface(object): #here we test for exception matches (ie. comics spanning more than one volume, known mismatches, etc). CV_EXcomicid = myDB.action("SELECT * from exceptions WHERE ComicID=?", [comicid]).fetchone() if CV_EXcomicid is None: # pass # - gcdinfo=parseit.GCDScraper(comicname, comicyear, comicissues, comicid) + gcdinfo=parseit.GCDScraper(comicname, comicyear, comicissues, comicid, quickmatch="yes") if gcdinfo == "No Match": #when it no matches, the image will always be blank...let's fix it. cvdata = mylar.cv.getComic(comicid,'comic')