FIX:(#1671) When adding series via the search results page, on some systems it would return an error due to the db not being populated in enough time. Now will wait 5s before attempting to load series detail page to display

This commit is contained in:
evilhero 2017-07-09 15:48:13 -04:00
parent e48ff520a1
commit 148533ccc2
2 changed files with 7 additions and 1 deletions

View File

@ -1358,6 +1358,11 @@ def havetotals(refreshit=None):
else:
recentstatus = 'Ended'
if recentstatus == 'Loading':
cpub = comic['ComicPublished']
else:
cpub = re.sub('(N)', '', comic['ComicPublished']).strip()
comics.append({"ComicID": comic['ComicID'],
"ComicName": comic['ComicName'],
"ComicSortName": comic['ComicSortName'],
@ -1366,7 +1371,7 @@ def havetotals(refreshit=None):
"ComicImage": comic['ComicImage'],
"LatestIssue": comic['LatestIssue'],
"LatestDate": comic['LatestDate'],
"ComicPublished": re.sub('(N)', '', comic['ComicPublished']).strip(),
"ComicPublished": cpub,
"Status": comic['Status'],
"recentstatus": recentstatus,
"percent": percent,

View File

@ -371,6 +371,7 @@ class WebInterface(object):
return serve_template(templatename="searchfix-2.html", title="In-Depth Results", sresults=sresults)
#print ("imported is: " + str(imported))
threading.Thread(target=importer.addComictoDB, args=[comicid, mismatch, None, imported, ogcname]).start()
time.sleep(5) #wait 5s so the db can be populated enough to display the page - otherwise will return to home page if not enough info is loaded.
raise cherrypy.HTTPRedirect("comicDetails?ComicID=%s" % comicid)
addComic.exposed = True