attempted fix for non-stop sends to SAB (and possibly related other things)

This commit is contained in:
evilhero 2013-01-02 11:57:28 -05:00
parent 02faa503b7
commit f977bb3d87
3 changed files with 41 additions and 33 deletions

View File

@ -363,11 +363,11 @@ def addComictoDB(comicid,mismatch=None,pullupd=None):
logger.info(u"Updating complete for: " + comic['ComicName'])
if pullupd == "no":
if pullupd is None:
# lets' check the pullist for anyting at this time as well since we're here.
if mylar.AUTOWANT_UPCOMING:
logger.info(u"Checking this week's pullist for new issues of " + str(comic['ComicName']))
updater.newpullcheck()
updater.newpullcheck(comic['ComicName'], comicid)
#here we grab issues that have been marked as wanted above...
@ -634,7 +634,7 @@ def GCDimport(gcomicid, pullupd=None):
logger.info(u"Updating complete for: " + ComicName)
if pullupd == "no":
if pullupd is None:
# lets' check the pullist for anyting at this time as well since we're here.
if mylar.AUTOWANT_UPCOMING:
logger.info(u"Checking this week's pullist for new issues of " + str(ComicName))

View File

@ -64,8 +64,9 @@ def upcoming_update(ComicID, ComicName, IssueNumber, IssueDate):
if CV_EXcomicid['variloop'] == '99':
mismatch = "yes"
logger.fdebug("Refreshing comic " + str(ComicName) + " to make sure it's up-to-date")
if ComicID[:1] == "G": mylar.importer.GCDimport(ComicID,pullupd="yes")
else: mylar.importer.addComictoDB(ComicID,mismatch,pullupd="yes")
pullupd = "yes"
if ComicID[:1] == "G": mylar.importer.GCDimport(ComicID,pullupd)
else: mylar.importer.addComictoDB(ComicID,mismatch,pullupd)
issuechk = myDB.action("SELECT * FROM issues WHERE ComicID=? AND Issue_Number=?", [ComicID, IssueNumber]).fetchone()
@ -113,9 +114,9 @@ def weekly_update(ComicName):
newValue = {"STATUS": "Skipped"}
myDB.upsert("weekly", newValue, controlValue)
def newpullcheck():
def newpullcheck(ComicName, ComicID):
# When adding a new comic, let's check for new issues on this week's pullist and update.
mylar.weeklypull.pullitcheck()
mylar.weeklypull.pullitcheck(ComicName, ComicID)
return
def no_searchresults(ComicID):
@ -278,11 +279,11 @@ def forceRescan(ComicID):
else:
# it's a word, skip it.
fcdigit = 1000000
logger.fdebug("fcdigit: " + str(fcdigit))
logger.fdebug("int_iss: " + str(int_iss))
#logger.fdebug("fcdigit: " + str(fcdigit))
#logger.fdebug("int_iss: " + str(int_iss))
if "." in str(int_iss):
int_iss = helpers.decimal_issue(int_iss)
logger.fdebug("this is the int issue:" + str(int_iss))
#logger.fdebug("this is the int issue:" + str(int_iss))
if int(fcdigit) == int_iss:
#if issyear in fcnew[som+1]:

View File

@ -310,7 +310,7 @@ def pullit():
os.remove( str(pullpath) + "newreleases.txt" )
pullitcheck()
def pullitcheck():
def pullitcheck(comic1off_name=None,comic1off_id=None):
myDB = db.DBConnection()
not_t = ['TP',
@ -345,25 +345,32 @@ def pullitcheck():
with con:
cur = con.cursor()
#let's read in the comic.watchlist from the db here
cur.execute("SELECT ComicID, ComicName, ComicYear, ComicPublisher from comics")
while True:
watchd = cur.fetchone()
if watchd == None:
break
a_list.append(watchd[1])
b_list.append(watchd[2])
comicid.append(watchd[0])
#print ( "Comic:" + str(a_list[w]) + " Year: " + str(b_list[w]) )
if "WOLVERINE AND THE X-MEN" in str(a_list[w]): a_list[w] = "WOLVERINE AND X-MEN"
lines.append(a_list[w].strip())
unlines.append(a_list[w].strip())
llen.append(a_list[w].splitlines())
ccname.append(a_list[w].strip())
tmpwords = a_list[w].split(None)
ltmpwords = len(tmpwords)
ltmp = 1
w+=1
# if it's a one-off check (during an add series), load the comicname here and ignore below.
if comic1off_name:
lines.append(comic1off_name.strip())
unlines.append(comic1off_name.strip())
comicid.append(comic1off_id)
w = 1
else:
#let's read in the comic.watchlist from the db here
cur.execute("SELECT ComicID, ComicName, ComicYear, ComicPublisher from comics")
while True:
watchd = cur.fetchone()
if watchd == None:
break
a_list.append(watchd[1])
b_list.append(watchd[2])
comicid.append(watchd[0])
#print ( "Comic:" + str(a_list[w]) + " Year: " + str(b_list[w]) )
#if "WOLVERINE AND THE X-MEN" in str(a_list[w]): a_list[w] = "WOLVERINE AND X-MEN"
lines.append(a_list[w].strip())
unlines.append(a_list[w].strip())
llen.append(a_list[w].splitlines())
ccname.append(a_list[w].strip())
tmpwords = a_list[w].split(None)
ltmpwords = len(tmpwords)
ltmp = 1
w+=1
cnt = int(w-1)
cntback = int(w-1)
kp = []
@ -376,7 +383,7 @@ def pullitcheck():
if w > 0:
while (cnt > -1):
lines[cnt] = str(lines[cnt]).upper()
llen[cnt] = str(llen[cnt])
#llen[cnt] = str(llen[cnt])
logger.fdebug("looking for : " + str(lines[cnt]))
sqlsearch = re.sub('[\_\#\,\/\:\;\.\-\!\$\%\&\+\'\?\@]', ' ', str(lines[cnt]))
sqlsearch = re.sub(r'\s', '%', sqlsearch)
@ -421,8 +428,8 @@ def pullitcheck():
else:
#print ( row[2] + " not an EXACT match...")
break
if "WOLVERINE AND X-MEN" in str(comicnm):
comicnm = "WOLVERINE AND THE X-MEN"
#if "WOLVERINE AND X-MEN" in str(comicnm):
# comicnm = "WOLVERINE AND THE X-MEN"
#print ("changed wolvy")
if ("NA" not in week['ISSUE']) and ("HC" not in week['ISSUE']):
if ("COMBO PACK" not in week['EXTRA']) and ("2ND PTG" not in week['EXTRA']) and ("3RD PTG" not in week['EXTRA']):