1
0
Fork 0
mirror of https://github.com/evilhero/mylar synced 2025-03-10 05:52:48 +00:00

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']) 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. # lets' check the pullist for anyting at this time as well since we're here.
if mylar.AUTOWANT_UPCOMING: if mylar.AUTOWANT_UPCOMING:
logger.info(u"Checking this week's pullist for new issues of " + str(comic['ComicName'])) 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... #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) 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. # lets' check the pullist for anyting at this time as well since we're here.
if mylar.AUTOWANT_UPCOMING: if mylar.AUTOWANT_UPCOMING:
logger.info(u"Checking this week's pullist for new issues of " + str(ComicName)) 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': if CV_EXcomicid['variloop'] == '99':
mismatch = "yes" mismatch = "yes"
logger.fdebug("Refreshing comic " + str(ComicName) + " to make sure it's up-to-date") logger.fdebug("Refreshing comic " + str(ComicName) + " to make sure it's up-to-date")
if ComicID[:1] == "G": mylar.importer.GCDimport(ComicID,pullupd="yes") pullupd = "yes"
else: mylar.importer.addComictoDB(ComicID,mismatch,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() 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"} newValue = {"STATUS": "Skipped"}
myDB.upsert("weekly", newValue, controlValue) 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. # 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 return
def no_searchresults(ComicID): def no_searchresults(ComicID):
@ -278,11 +279,11 @@ def forceRescan(ComicID):
else: else:
# it's a word, skip it. # it's a word, skip it.
fcdigit = 1000000 fcdigit = 1000000
logger.fdebug("fcdigit: " + str(fcdigit)) #logger.fdebug("fcdigit: " + str(fcdigit))
logger.fdebug("int_iss: " + str(int_iss)) #logger.fdebug("int_iss: " + str(int_iss))
if "." in str(int_iss): if "." in str(int_iss):
int_iss = helpers.decimal_issue(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 int(fcdigit) == int_iss:
#if issyear in fcnew[som+1]: #if issyear in fcnew[som+1]:

View file

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