mirror of
https://github.com/evilhero/mylar
synced 2025-01-03 05:24:43 +00:00
FIX:(#2383) Quick patch to bandaid the incorrect writing of a dict to the searchresults table of the db
This commit is contained in:
parent
4f8943b5b5
commit
00d7107d40
1 changed files with 11 additions and 5 deletions
|
@ -4692,13 +4692,17 @@ class WebInterface(object):
|
||||||
if len(search_matches) > 1:
|
if len(search_matches) > 1:
|
||||||
# if we matched on more than one series above, just save those results instead of the entire search result set.
|
# if we matched on more than one series above, just save those results instead of the entire search result set.
|
||||||
for sres in search_matches:
|
for sres in search_matches:
|
||||||
|
if type(sres['haveit']) == dict:
|
||||||
|
imp_cid = sres['haveit']['comicid']
|
||||||
|
else:
|
||||||
|
imp_cid = sres['haveit']
|
||||||
cVal = {"SRID": SRID,
|
cVal = {"SRID": SRID,
|
||||||
"comicid": sres['comicid']}
|
"comicid": sres['comicid']}
|
||||||
#should store ogcname in here somewhere to account for naming conversions above.
|
#should store ogcname in here somewhere to account for naming conversions above.
|
||||||
nVal = {"Series": ComicName,
|
nVal = {"Series": ComicName,
|
||||||
"results": len(search_matches),
|
"results": len(search_matches),
|
||||||
"publisher": sres['publisher'],
|
"publisher": sres['publisher'],
|
||||||
"haveit": sres['haveit'],
|
"haveit": imp_cid,
|
||||||
"name": sres['name'],
|
"name": sres['name'],
|
||||||
"deck": sres['deck'],
|
"deck": sres['deck'],
|
||||||
"url": sres['url'],
|
"url": sres['url'],
|
||||||
|
@ -4707,7 +4711,7 @@ class WebInterface(object):
|
||||||
"issues": sres['issues'],
|
"issues": sres['issues'],
|
||||||
"ogcname": ogcname,
|
"ogcname": ogcname,
|
||||||
"comicyear": sres['comicyear']}
|
"comicyear": sres['comicyear']}
|
||||||
logger.fdebug('search_values: [%s]/%s' % (cVal, nVal))
|
#logger.fdebug('search_values: [%s]/%s' % (cVal, nVal))
|
||||||
myDB.upsert("searchresults", nVal, cVal)
|
myDB.upsert("searchresults", nVal, cVal)
|
||||||
logger.info('[IMPORT] There is more than one result that might be valid - normally this is due to the filename(s) not having enough information for me to use (ie. no volume label/year). Manual intervention is required.')
|
logger.info('[IMPORT] There is more than one result that might be valid - normally this is due to the filename(s) not having enough information for me to use (ie. no volume label/year). Manual intervention is required.')
|
||||||
#force the status here just in case
|
#force the status here just in case
|
||||||
|
@ -4719,13 +4723,17 @@ class WebInterface(object):
|
||||||
# store the search results for series that returned more than one result for user to select later / when they want.
|
# store the search results for series that returned more than one result for user to select later / when they want.
|
||||||
# should probably assign some random numeric for an id to reference back at some point.
|
# should probably assign some random numeric for an id to reference back at some point.
|
||||||
for sres in sresults:
|
for sres in sresults:
|
||||||
|
if type(sres['haveit']) == dict:
|
||||||
|
imp_cid = sres['haveit']['comicid']
|
||||||
|
else:
|
||||||
|
imp_cid = sres['haveit']
|
||||||
cVal = {"SRID": SRID,
|
cVal = {"SRID": SRID,
|
||||||
"comicid": sres['comicid']}
|
"comicid": sres['comicid']}
|
||||||
#should store ogcname in here somewhere to account for naming conversions above.
|
#should store ogcname in here somewhere to account for naming conversions above.
|
||||||
nVal = {"Series": ComicName,
|
nVal = {"Series": ComicName,
|
||||||
"results": len(sresults),
|
"results": len(sresults),
|
||||||
"publisher": sres['publisher'],
|
"publisher": sres['publisher'],
|
||||||
"haveit": sres['haveit'],
|
"haveit": imp_cid,
|
||||||
"name": sres['name'],
|
"name": sres['name'],
|
||||||
"deck": sres['deck'],
|
"deck": sres['deck'],
|
||||||
"url": sres['url'],
|
"url": sres['url'],
|
||||||
|
@ -6435,5 +6443,3 @@ class WebInterface(object):
|
||||||
#data = wv.read_comic(ish_id)
|
#data = wv.read_comic(ish_id)
|
||||||
return data
|
return data
|
||||||
read_comic.exposed = True
|
read_comic.exposed = True
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue