mirror of https://github.com/evilhero/mylar
FIX:(#1715) When manually renaming from series detail page, would fail due to an invalid reference, FIX: Fixed some icon display issues with annuals and annual integration not dislaying proper ones, FIX: Annuals were not being refreshed that were previously present, due to a commit fix, IMP: Removed some code not needed
This commit is contained in:
parent
8d9d275f07
commit
0f1a3578f3
|
@ -437,7 +437,7 @@
|
|||
|
||||
<form action="markannuals" method="get" id="markannuals">
|
||||
<div id="markannuals">Mark selected annuals as
|
||||
<select name="ann_action" onChange="doAjaxCall('markannuals',$(this),'table',true);" data-success="selected annuals marked">
|
||||
<select name="ann_action" onChange="doAjaxCall('markannuals',$(this),'table',true)" data-success="selected annuals marked">
|
||||
<option disabled="disabled" selected="selected">Choose...</option>
|
||||
<option value="Wanted">Wanted</option>
|
||||
<option value="Skipped">Skipped</option>
|
||||
|
@ -522,7 +522,11 @@
|
|||
if annual['Location'] is not None:
|
||||
linky = os.path.join(comic['ComicLocation'],annual['Location'])
|
||||
if not os.path.isfile(linky):
|
||||
linky = None
|
||||
if mylar.MULTIPLE_DEST_DIRS is not None and mylar.MULTIPLE_DEST_DIRS != 'None':
|
||||
pathdir = os.path.join(mylar.MULTIPLE_DEST_DIRS, os.path.basename(comic['ComicLocation']))
|
||||
linky = os.path.join(pathdir,issue['Location'])
|
||||
else:
|
||||
linky = None
|
||||
else:
|
||||
linky = None
|
||||
%>
|
||||
|
|
|
@ -550,6 +550,14 @@ table.display tr.odd.row_selected td {
|
|||
background-color: #9FAFD1;
|
||||
}
|
||||
|
||||
table.display_no_select tr.even.row_selected td {
|
||||
background-color: #B0BED9;
|
||||
}
|
||||
|
||||
table.display_no_select tr.odd.row_selected td {
|
||||
background-color: #9FAFD1;
|
||||
}
|
||||
|
||||
div.box {
|
||||
height: 100px;
|
||||
padding: 10px;
|
||||
|
|
|
@ -420,7 +420,7 @@ def addComictoDB(comicid, mismatch=None, pullupd=None, imported=None, ogcname=No
|
|||
|
||||
#move to own function so can call independently to only refresh issue data
|
||||
#issued is from cv.getComic, comic['ComicName'] & comicid would both be already known to do independent call.
|
||||
issuedata = updateissuedata(comicid, comic['ComicName'], issued, comicIssues, calledfrom, SeriesYear=SeriesYear, latestissueinfo=latestissueinfo)
|
||||
issuedata, anndata = updateissuedata(comicid, comic['ComicName'], issued, comicIssues, calledfrom, SeriesYear=SeriesYear, latestissueinfo=latestissueinfo)
|
||||
if issuedata is None:
|
||||
logger.warn('Unable to complete Refreshing / Adding issue data - this WILL create future problems if not addressed.')
|
||||
return
|
||||
|
@ -439,7 +439,7 @@ def addComictoDB(comicid, mismatch=None, pullupd=None, imported=None, ogcname=No
|
|||
|
||||
elif calledfrom == 'dbupdate':
|
||||
logger.info('returning to dbupdate module')
|
||||
return issuedata # this should be the issuedata data from updateissuedata function
|
||||
return issuedata, anndata # this should be the issuedata data from updateissuedata function
|
||||
|
||||
elif calledfrom == 'weeklycheck':
|
||||
logger.info('Successfully refreshed ' + comic['ComicName'] + ' (' + str(SeriesYear) + '). Returning to Weekly issue update.')
|
||||
|
@ -985,66 +985,72 @@ def issue_collection(issuedata, nostatus):
|
|||
return
|
||||
|
||||
|
||||
def manualAnnual(manual_comicid, comicname, comicyear, comicid):
|
||||
def manualAnnual(manual_comicid=None, comicname=None, comicyear=None, comicid=None, annchk=None, manualupd=False):
|
||||
#called when importing/refreshing an annual that was manually added.
|
||||
myDB = db.DBConnection()
|
||||
issueid = manual_comicid
|
||||
logger.fdebug(str(issueid) + ' added to series list as an Annual')
|
||||
sr = cv.getComic(manual_comicid, 'comic')
|
||||
logger.info('Attempting to integrate ' + sr['ComicName'] + ' (' + str(issueid) + ') to the existing series of ' + comicname + '(' + str(comicyear) + ')')
|
||||
if len(sr) is None or len(sr) == 0:
|
||||
logger.fdebug('Could not find any information on the series indicated : ' + str(manual_comicid))
|
||||
return
|
||||
else:
|
||||
n = 0
|
||||
issued = cv.getComic(re.sub('4050-', '', manual_comicid).strip(), 'issue')
|
||||
if int(sr['ComicIssues']) == 0 and len(issued['issuechoice']) == 1:
|
||||
noissues = 1
|
||||
if annchk is None:
|
||||
annchk = []
|
||||
issueid = manual_comicid
|
||||
logger.fdebug(str(issueid) + ' added to series list as an Annual')
|
||||
sr = cv.getComic(manual_comicid, 'comic')
|
||||
logger.fdebug('Attempting to integrate ' + sr['ComicName'] + ' (' + str(issueid) + ') to the existing series of ' + comicname + '(' + str(comicyear) + ')')
|
||||
if len(sr) is None or len(sr) == 0:
|
||||
logger.fdebug('Could not find any information on the series indicated : ' + str(manual_comicid))
|
||||
return
|
||||
else:
|
||||
noissues = sr['ComicIssues']
|
||||
logger.fdebug('there are ' + str(noissues) + ' annuals within this series.')
|
||||
while (n < int(noissues)):
|
||||
try:
|
||||
firstval = issued['issuechoice'][n]
|
||||
except IndexError:
|
||||
break
|
||||
try:
|
||||
cleanname = helpers.cleanName(firstval['Issue_Name'])
|
||||
except:
|
||||
cleanname = 'None'
|
||||
issid = str(firstval['Issue_ID'])
|
||||
issnum = str(firstval['Issue_Number'])
|
||||
issname = cleanname
|
||||
issdate = str(firstval['Issue_Date'])
|
||||
stdate = str(firstval['Store_Date'])
|
||||
logger.fdebug('comicname:' + str(comicname))
|
||||
logger.fdebug('comicid:' + str(comicid))
|
||||
logger.fdebug('issid:' + str(issid))
|
||||
logger.fdebug('cleanname:' + str(cleanname))
|
||||
logger.fdebug('issnum:' + str(issnum))
|
||||
logger.fdebug('issdate:' + str(issdate))
|
||||
logger.fdebug('stdate:' + str(stdate))
|
||||
newCtrl = {"IssueID": issid}
|
||||
newVals = {"Issue_Number": issnum,
|
||||
"Int_IssueNumber": helpers.issuedigits(issnum),
|
||||
"IssueDate": issdate,
|
||||
"ReleaseDate": stdate,
|
||||
"IssueName": issname,
|
||||
"ComicID": comicid, #this is the series ID
|
||||
"ReleaseComicID": re.sub('4050-', '', manual_comicid).strip(), #this is the series ID for the annual(s)
|
||||
"ComicName": comicname, #series ComicName
|
||||
"ReleaseComicName": sr['ComicName'], #series ComicName for the manual_comicid
|
||||
"Status": "Skipped"}
|
||||
#need to add in the values for the new series to be added.
|
||||
#"M_ComicName": sr['ComicName'],
|
||||
#"M_ComicID": manual_comicid}
|
||||
myDB.upsert("annuals", newVals, newCtrl)
|
||||
n+=1
|
||||
logger.info('Successfully integrated ' + str(n) + ' issues of ' + sr['ComicName'] + ' to the series: ' + comicname)
|
||||
n = 0
|
||||
issued = cv.getComic(re.sub('4050-', '', manual_comicid).strip(), 'issue')
|
||||
if int(sr['ComicIssues']) == 0 and len(issued['issuechoice']) == 1:
|
||||
noissues = 1
|
||||
else:
|
||||
noissues = sr['ComicIssues']
|
||||
logger.fdebug('there are ' + str(noissues) + ' annuals within this series.')
|
||||
while (n < int(noissues)):
|
||||
try:
|
||||
firstval = issued['issuechoice'][n]
|
||||
except IndexError:
|
||||
break
|
||||
try:
|
||||
cleanname = helpers.cleanName(firstval['Issue_Name'])
|
||||
except:
|
||||
cleanname = 'None'
|
||||
annchk.append({'IssueID': str(firstval['Issue_ID']),
|
||||
'ComicID': comicid,
|
||||
'ReleaseComicID': re.sub('4050-', '', manual_comicid).strip(),
|
||||
'ComicName': comicname,
|
||||
'Issue_Number': str(firstval['Issue_Number']),
|
||||
'IssueName': cleanname,
|
||||
'IssueDate': str(firstval['Issue_Date']),
|
||||
'ReleaseDate': str(firstval['Store_Date']),
|
||||
'Status': 'Skipped',
|
||||
'ReleaseComicName': sr['ComicName']})
|
||||
n+=1
|
||||
|
||||
if manualupd is True:
|
||||
return annchk
|
||||
|
||||
for ann in annchk:
|
||||
newCtrl = {"IssueID": ann['IssueID']}
|
||||
newVals = {"Issue_Number": ann['Issue_Number'],
|
||||
"Int_IssueNumber": helpers.issuedigits(ann['Issue_Number']),
|
||||
"IssueDate": ann['IssueDate'],
|
||||
"ReleaseDate": ann['ReleaseDate'],
|
||||
"IssueName": ann['IssueName'],
|
||||
"ComicID": ann['ComicID'], #this is the series ID
|
||||
"ReleaseComicID": ann['ReleaseComicID'], #this is the series ID for the annual(s)
|
||||
"ComicName": ann['ComicName'], #series ComicName
|
||||
"ReleaseComicName": ann['ReleaseComicName'], #series ComicName for the manual_comicid
|
||||
"Status": ann['Status']}
|
||||
#need to add in the values for the new series to be added.
|
||||
#"M_ComicName": sr['ComicName'],
|
||||
#"M_ComicID": manual_comicid}
|
||||
myDB.upsert("annuals", newVals, newCtrl)
|
||||
logger.info('Successfully integrated ' + str(len(annchk)) + ' annuals into the series: ' + annchk[0]['ComicName'])
|
||||
return
|
||||
|
||||
|
||||
def updateissuedata(comicid, comicname=None, issued=None, comicIssues=None, calledfrom=None, issuechk=None, issuetype=None, SeriesYear=None, latestissueinfo=None):
|
||||
annualchk = []
|
||||
weeklyissue_check = []
|
||||
logger.fdebug('issuedata call references...')
|
||||
logger.fdebug('comicid:' + str(comicid))
|
||||
|
@ -1074,9 +1080,9 @@ def updateissuedata(comicid, comicname=None, issued=None, comicIssues=None, call
|
|||
return
|
||||
|
||||
# poll against annuals here - to make sure annuals are uptodate.
|
||||
weeklyissue_check = annual_check(comicname, SeriesYear, comicid, issuetype, issuechk, weeklyissue_check)
|
||||
if weeklyissue_check is None:
|
||||
weeklyissue_check = []
|
||||
annualchk = annual_check(comicname, SeriesYear, comicid, issuetype, issuechk, annualchk)
|
||||
if annualchk is None:
|
||||
annualchk = []
|
||||
logger.fdebug('Finshed Annual checking.')
|
||||
|
||||
n = 0
|
||||
|
@ -1349,11 +1355,11 @@ def updateissuedata(comicid, comicname=None, issued=None, comicIssues=None, call
|
|||
return weeklyissue_check
|
||||
|
||||
elif calledfrom == 'dbupdate':
|
||||
return issuedata
|
||||
return issuedata, annualchk
|
||||
|
||||
return importantdates
|
||||
|
||||
def annual_check(ComicName, SeriesYear, comicid, issuetype, issuechk, weeklyissue_check):
|
||||
def annual_check(ComicName, SeriesYear, comicid, issuetype, issuechk, annualslist):
|
||||
annualids = [] #to be used to make sure an ID isn't double-loaded
|
||||
annload = []
|
||||
anncnt = 0
|
||||
|
@ -1381,7 +1387,7 @@ def annual_check(ComicName, SeriesYear, comicid, issuetype, issuechk, weeklyissu
|
|||
for manchk in annload:
|
||||
if manchk['ReleaseComicID'] is not None or manchk['ReleaseComicID'] is not None: #if it exists, then it's a pre-existing add
|
||||
#print str(manchk['ReleaseComicID']), comic['ComicName'], str(SeriesYear), str(comicid)
|
||||
manualAnnual(manchk['ReleaseComicID'], ComicName, SeriesYear, comicid)
|
||||
annualslist += manualAnnual(manchk['ReleaseComicID'], ComicName, SeriesYear, comicid, manualupd=True)
|
||||
annualids.append(manchk['ReleaseComicID'])
|
||||
|
||||
annualcomicname = re.sub('[\,\:]', '', ComicName)
|
||||
|
@ -1419,7 +1425,7 @@ def annual_check(ComicName, SeriesYear, comicid, issuetype, issuechk, weeklyissu
|
|||
issueid = sr['comicid']
|
||||
logger.fdebug('[IMPORTER-ANNUAL] - ' + str(issueid) + ' added to series list as an Annual')
|
||||
if issueid in annualids:
|
||||
logger.fdebug('[IMPORTER-ANNUAL] - ' + str(issueid) + ' already exists & was refreshed.')
|
||||
logger.fdebug('[IMPORTER-ANNUAL] - ' + str(issueid) + ' already exists within current annual list for series.')
|
||||
num_res+=1 # need to manually increment since not a for-next loop
|
||||
continue
|
||||
issued = cv.getComic(issueid, 'issue')
|
||||
|
@ -1452,41 +1458,44 @@ def annual_check(ComicName, SeriesYear, comicid, issuetype, issuechk, weeklyissu
|
|||
stdate = str(firstval['Store_Date'])
|
||||
int_issnum = helpers.issuedigits(issnum)
|
||||
|
||||
newVals = {"Issue_Number": issnum,
|
||||
"Int_IssueNumber": int_issnum,
|
||||
"IssueDate": issdate,
|
||||
"ReleaseDate": stdate,
|
||||
"IssueName": issname,
|
||||
"ComicID": comicid,
|
||||
"ComicName": ComicName,
|
||||
"ReleaseComicID": re.sub('4050-', '', firstval['Comic_ID']).strip(),
|
||||
"ReleaseComicName": sr['name']}
|
||||
|
||||
iss_exists = myDB.selectone('SELECT * from annuals WHERE IssueID=?', [issid]).fetchone()
|
||||
if iss_exists is None:
|
||||
datechk = re.sub('-', '', issdate).strip() # converts date to 20140718 format
|
||||
if mylar.AUTOWANT_ALL:
|
||||
newVals['Status'] = "Wanted"
|
||||
astatus = "Wanted"
|
||||
elif int(datechk) >= int(nowtime) and mylar.AUTOWANT_UPCOMING:
|
||||
newVals['Status'] = "Wanted"
|
||||
astatus = "Wanted"
|
||||
else:
|
||||
newVals['Status'] = "Skipped"
|
||||
astatus = "Skipped"
|
||||
else:
|
||||
newVals['Status'] = iss_exists['Status']
|
||||
astatus = iss_exists['Status']
|
||||
|
||||
newCtrl = {"IssueID": issid}
|
||||
myDB.upsert("annuals", newVals, newCtrl)
|
||||
annualslist.append({"Issue_Number": issnum,
|
||||
"Int_IssueNumber": int_issnum,
|
||||
"IssueDate": issdate,
|
||||
"ReleaseDate": stdate,
|
||||
"IssueName": issname,
|
||||
"ComicID": comicid,
|
||||
"IssueID": issid,
|
||||
"ComicName": ComicName,
|
||||
"ReleaseComicID": re.sub('4050-', '', firstval['Comic_ID']).strip(),
|
||||
"ReleaseComicName": sr['name'],
|
||||
"Status": astatus})
|
||||
|
||||
if issuechk is not None and issuetype == 'annual':
|
||||
#logger.fdebug('[IMPORTER-ANNUAL] - Comparing annual ' + str(issuechk) + ' .. to .. ' + str(int_issnum))
|
||||
if issuechk == int_issnum:
|
||||
weeklyissue_check.append({"Int_IssueNumber": int_issnum,
|
||||
"Issue_Number": issnum,
|
||||
"IssueDate": issdate,
|
||||
"ReleaseDate": stdate})
|
||||
#myDB.upsert("annuals", newVals, newCtrl)
|
||||
|
||||
# --- don't think this does anything since the value isn't returned in this module
|
||||
#if issuechk is not None and issuetype == 'annual':
|
||||
# #logger.fdebug('[IMPORTER-ANNUAL] - Comparing annual ' + str(issuechk) + ' .. to .. ' + str(int_issnum))
|
||||
# if issuechk == int_issnum:
|
||||
# weeklyissue_check.append({"Int_IssueNumber": int_issnum,
|
||||
# "Issue_Number": issnum,
|
||||
# "IssueDate": issdate,
|
||||
# "ReleaseDate": stdate})
|
||||
|
||||
n+=1
|
||||
num_res+=1
|
||||
return annualslist
|
||||
|
||||
elif len(sresults) == 0 or len(sresults) is None:
|
||||
logger.fdebug('[IMPORTER-ANNUAL] - No results, removing the year from the agenda and re-querying.')
|
||||
|
@ -1505,4 +1514,3 @@ def annual_check(ComicName, SeriesYear, comicid, issuetype, issuechk, weeklyissu
|
|||
logger.fdebug('[IMPORTER-ANNUAL] - Issue count is wrong')
|
||||
|
||||
#if this is called from the importer module, return the weeklyissue_check
|
||||
#return weeklyissue_check
|
||||
|
|
|
@ -177,14 +177,16 @@ def dbUpdate(ComicIDList=None, calledfrom=None, sched=False):
|
|||
logger.fdebug("Refreshing the series and pulling in new data using only CV.")
|
||||
|
||||
if whack == False:
|
||||
cchk = mylar.importer.addComictoDB(ComicID, mismatch, calledfrom='dbupdate', annload=annload, csyear=csyear)
|
||||
|
||||
cchk, annchk = mylar.importer.addComictoDB(ComicID, mismatch, calledfrom='dbupdate', annload=annload, csyear=csyear)
|
||||
if cchk:
|
||||
#delete the data here if it's all valid.
|
||||
logger.fdebug("Deleting all old issue data to make sure new data is clean...")
|
||||
myDB.action('DELETE FROM issues WHERE ComicID=?', [ComicID])
|
||||
myDB.action('DELETE FROM annuals WHERE ComicID=?', [ComicID])
|
||||
mylar.importer.issue_collection(cchk, nostatus='True')
|
||||
#need to update annuals at this point too....
|
||||
if annchk:
|
||||
mylar.importer.manualAnnual(annchk=annchk)
|
||||
else:
|
||||
logger.warn('There was an error when refreshing this series - Make sure directories are writable/exist, etc')
|
||||
return
|
||||
|
|
|
@ -847,149 +847,6 @@ class WebInterface(object):
|
|||
threading.Thread(target=updater.dbUpdate, args=[comicsToAdd]).start()
|
||||
refreshSeries.exposed = True
|
||||
|
||||
def refreshArtist(self, ComicID):
|
||||
myDB = db.DBConnection()
|
||||
mismatch = "no"
|
||||
logger.fdebug('Refreshing comicid: ' + str(ComicID))
|
||||
if not mylar.CV_ONLY or ComicID[:1] == "G":
|
||||
|
||||
CV_EXcomicid = myDB.selectone("SELECT * from exceptions WHERE ComicID=?", [ComicID]).fetchone()
|
||||
if CV_EXcomicid is None: pass
|
||||
else:
|
||||
if CV_EXcomicid['variloop'] == '99':
|
||||
mismatch = "yes"
|
||||
if ComicID[:1] == "G": threading.Thread(target=importer.GCDimport, args=[ComicID]).start()
|
||||
else: threading.Thread(target=importer.addComictoDB, args=[ComicID, mismatch]).start()
|
||||
else:
|
||||
if mylar.CV_ONETIMER == 1:
|
||||
logger.fdebug("CV_OneTimer option enabled...")
|
||||
#in order to update to JUST CV_ONLY, we need to delete the issues for a given series so it's a clean grab.
|
||||
logger.fdebug("Gathering the status of all issues for the series.")
|
||||
|
||||
issues = myDB.select('SELECT * FROM issues WHERE ComicID=?', [ComicID])
|
||||
|
||||
if not issues:
|
||||
#if issues are None it's probably a bad refresh/maxed out API that resulted in the issue data
|
||||
#getting wiped out and not refreshed. Setting whack=True will force a complete refresh.
|
||||
logger.info('No issue data available. This is Whack.')
|
||||
whack = True
|
||||
else:
|
||||
#check for series that are numerically out of whack (ie. 5/4)
|
||||
logger.info('Checking how out of whack the series is.')
|
||||
whack = helpers.havetotals(refreshit=ComicID)
|
||||
|
||||
|
||||
annload = [] #initiate the list here so we don't error out below.
|
||||
|
||||
if mylar.ANNUALS_ON:
|
||||
#now we load the annuals into memory to pass through to importer when refreshing so that it can
|
||||
#refresh even the manually added annuals.
|
||||
annual_load = myDB.select('SELECT * FROM annuals WHERE ComicID=?', [ComicID])
|
||||
logger.fdebug('checking annual db')
|
||||
for annthis in annual_load:
|
||||
if not any(d['ReleaseComicID'] == annthis['ReleaseComicID'] for d in annload):
|
||||
annload.append({
|
||||
'ReleaseComicID': annthis['ReleaseComicID'],
|
||||
'ReleaseComicName': annthis['ReleaseComicName'],
|
||||
'ComicID': annthis['ComicID'],
|
||||
'ComicName': annthis['ComicName']
|
||||
})
|
||||
issues += annual_load #myDB.select('SELECT * FROM annuals WHERE ComicID=?', [ComicID])
|
||||
#store the issues' status for a given comicid, after deleting and readding, flip the status back to$
|
||||
logger.fdebug("Deleting all issue data.")
|
||||
myDB.action('DELETE FROM issues WHERE ComicID=?', [ComicID])
|
||||
myDB.action('DELETE FROM annuals WHERE ComicID=?', [ComicID])
|
||||
logger.fdebug("Refreshing the series and pulling in new data using only CV.")
|
||||
if whack == False:
|
||||
cchk = mylar.importer.addComictoDB(ComicID, mismatch, calledfrom='dbupdate', annload=annload)
|
||||
#reload the annuals here.
|
||||
|
||||
issues_new = myDB.select('SELECT * FROM issues WHERE ComicID=?', [ComicID])
|
||||
annuals = []
|
||||
ann_list = []
|
||||
if mylar.ANNUALS_ON:
|
||||
annuals_list = myDB.select('SELECT * FROM annuals WHERE ComicID=?', [ComicID])
|
||||
ann_list += annuals_list
|
||||
issues_new += annuals_list
|
||||
|
||||
logger.fdebug("Attempting to put the Status' back how they were.")
|
||||
icount = 0
|
||||
#the problem - the loop below will not match on NEW issues that have been refreshed that weren't present in the
|
||||
#db before (ie. you left Mylar off for abit, and when you started it up it pulled down new issue information)
|
||||
#need to test if issuenew['Status'] is None, but in a seperate loop below.
|
||||
fndissue = []
|
||||
for issue in issues:
|
||||
for issuenew in issues_new:
|
||||
#logger.fdebug(str(issue['Issue_Number']) + ' - issuenew:' + str(issuenew['IssueID']) + ' : ' + str(issuenew['Status']))
|
||||
#logger.fdebug(str(issue['Issue_Number']) + ' - issue:' + str(issue['IssueID']) + ' : ' + str(issue['Status']))
|
||||
if issuenew['IssueID'] == issue['IssueID'] and issuenew['Status'] != issue['Status']:
|
||||
ctrlVAL = {"IssueID": issue['IssueID']}
|
||||
#if the status is None and the original status is either Downloaded / Archived, keep status & stats
|
||||
if issuenew['Status'] == None and (issue['Status'] == 'Downloaded' or issue['Status'] == 'Archived'):
|
||||
newVAL = {"Location": issue['Location'],
|
||||
"ComicSize": issue['ComicSize'],
|
||||
"Status": issue['Status']}
|
||||
#if the status is now Downloaded/Snatched, keep status & stats (downloaded only)
|
||||
elif issuenew['Status'] == 'Downloaded' or issue['Status'] == 'Snatched':
|
||||
newVAL = {"Location": issue['Location'],
|
||||
"ComicSize": issue['ComicSize']}
|
||||
if issuenew['Status'] == 'Downloaded':
|
||||
newVAL['Status'] = issuenew['Status']
|
||||
else:
|
||||
newVAL['Status'] = issue['Status']
|
||||
|
||||
elif issue['Status'] == 'Archived':
|
||||
newVAL = {"Status": issue['Status'],
|
||||
"Location": issue['Location'],
|
||||
"ComicSize": issue['ComicSize']}
|
||||
else:
|
||||
#change the status to the previous status
|
||||
newVAL = {"Status": issue['Status']}
|
||||
|
||||
if newVAL['Status'] == None:
|
||||
newVAL = {"Status": "Skipped"}
|
||||
|
||||
if any(d['IssueID'] == str(issue['IssueID']) for d in ann_list):
|
||||
logger.fdebug("annual detected for " + str(issue['IssueID']) + " #: " + str(issue['Issue_Number']))
|
||||
myDB.upsert("Annuals", newVAL, ctrlVAL)
|
||||
else:
|
||||
#logger.fdebug('#' + str(issue['Issue_Number']) + ' writing issuedata: ' + str(newVAL))
|
||||
myDB.upsert("Issues", newVAL, ctrlVAL)
|
||||
fndissue.append({"IssueID": issue['IssueID']})
|
||||
icount+=1
|
||||
break
|
||||
logger.info("In the process of converting the data to CV, I changed the status of " + str(icount) + " issues.")
|
||||
|
||||
issues_new = myDB.select('SELECT * FROM issues WHERE ComicID=? AND Status is NULL', [ComicID])
|
||||
if mylar.ANNUALS_ON:
|
||||
issues_new += myDB.select('SELECT * FROM annuals WHERE ComicID=? AND Status is NULL', [ComicID])
|
||||
|
||||
newiss = []
|
||||
if mylar.AUTOWANT_UPCOMING:
|
||||
#only mark store date >= current date as Wanted.
|
||||
newstatus = "Wanted"
|
||||
else:
|
||||
newstatus = "Skipped"
|
||||
for iss in issues_new:
|
||||
newiss.append({"IssueID": iss['IssueID'],
|
||||
"Status": newstatus})
|
||||
if len(newiss) > 0:
|
||||
for newi in newiss:
|
||||
ctrlVAL = {"IssueID": newi['IssueID']}
|
||||
newVAL = {"Status": newi['Status']}
|
||||
#logger.info('writing issuedata: ' + str(newVAL))
|
||||
myDB.upsert("Issues", newVAL, ctrlVAL)
|
||||
|
||||
logger.info('I have added ' + str(len(newiss)) + ' new issues for this series that were not present before.')
|
||||
else:
|
||||
cchk = mylar.importer.addComictoDB(ComicID, mismatch, annload=annload)
|
||||
|
||||
else:
|
||||
cchk = mylar.importer.addComictoDB(ComicID, mismatch)
|
||||
|
||||
raise cherrypy.HTTPRedirect("comicDetails?ComicID=%s" % ComicID)
|
||||
refreshArtist.exposed=True
|
||||
|
||||
def issue_edit(self, id, value):
|
||||
logger.fdebug('id: ' + str(id))
|
||||
logger.fdebug('value: ' + str(value))
|
||||
|
@ -1051,7 +908,7 @@ class WebInterface(object):
|
|||
newaction = action
|
||||
|
||||
for IssueID in args:
|
||||
if any([IssueID is None, 'issue_table' in IssueID, 'history_table' in IssueID, 'manage_issues' in IssueID, 'issue_table_length' in IssueID, 'issues' in IssueID, 'annuals' in IssueID]):
|
||||
if any([IssueID is None, 'issue_table' in IssueID, 'history_table' in IssueID, 'manage_issues' in IssueID, 'issue_table_length' in IssueID, 'issues' in IssueID, 'annuals' in IssueID, 'annual_table_length' in IssueID]):
|
||||
continue
|
||||
else:
|
||||
mi = myDB.selectone("SELECT * FROM issues WHERE IssueID=?", [IssueID]).fetchone()
|
||||
|
@ -2164,21 +2021,22 @@ class WebInterface(object):
|
|||
logger.error("Cannot rename files.")
|
||||
return
|
||||
|
||||
if len(comicid) > 1:
|
||||
if type(comicid) is not unicode:
|
||||
comiclist = comicid
|
||||
else:
|
||||
comiclist = []
|
||||
comiclist.append(comicid)
|
||||
myDB = db.DBConnection()
|
||||
filefind = 0
|
||||
for comicid in comiclist:
|
||||
comic = myDB.selectone("SELECT * FROM comics WHERE ComicID=?", [comicid]).fetchone()
|
||||
for cid in comiclist:
|
||||
comic = myDB.selectone("SELECT * FROM comics WHERE ComicID=?", [cid]).fetchone()
|
||||
comicdir = comic['ComicLocation']
|
||||
comicname = comic['ComicName']
|
||||
comicyear = comic['ComicYear']
|
||||
extensions = ('.cbr', '.cbz', '.cb7')
|
||||
issues = myDB.select("SELECT * FROM issues WHERE ComicID=?", [comicid])
|
||||
issues = myDB.select("SELECT * FROM issues WHERE ComicID=?", [cid])
|
||||
if mylar.ANNUALS_ON:
|
||||
issues += myDB.select("SELECT * FROM annuals WHERE ComicID=?", [comicid])
|
||||
issues += myDB.select("SELECT * FROM annuals WHERE ComicID=?", [cid])
|
||||
if mylar.MULTIPLE_DEST_DIRS is not None and mylar.MULTIPLE_DEST_DIRS != 'None' and os.path.join(mylar.MULTIPLE_DEST_DIRS, os.path.basename(comicdir)) != comicdir:
|
||||
logger.fdebug('multiple_dest_dirs:' + mylar.MULTIPLE_DEST_DIRS)
|
||||
logger.fdebug('dir: ' + comicdir)
|
||||
|
@ -2196,7 +2054,7 @@ class WebInterface(object):
|
|||
annualize = 'yes'
|
||||
else:
|
||||
annualize = None
|
||||
renameiss = helpers.rename_param(comicid, comicname, issue['Issue_Number'], filename, comicyear=None, issueid=issue['IssueID'], annualize=annualize)
|
||||
renameiss = helpers.rename_param(cid, comicname, issue['Issue_Number'], filename, comicyear=comicyear, issueid=issue['IssueID'], annualize=annualize)
|
||||
nfilename = renameiss['nfilename']
|
||||
srciss = os.path.join(comicdir, filename)
|
||||
if filename != nfilename:
|
||||
|
|
Loading…
Reference in New Issue