mirror of
https://github.com/rembo10/headphones.git
synced 2026-05-20 10:35:32 +01:00
Fix error 500 when importer is longer than 5 seconds. Also eliminates the forced 5 second wait when adding an artist.
This commit is contained in:
@@ -68,6 +68,14 @@ def addArtisttoDB(artistid, extrasonly=False):
|
||||
return
|
||||
|
||||
myDB = db.DBConnection()
|
||||
|
||||
# We need the current minimal info in the database instantly
|
||||
# so we don't throw a 500 error when we redirect to the artistPage
|
||||
|
||||
controlValueDict = {"ArtistID": artistid}
|
||||
newValueDict = {"ArtistName": "Artist ID: %s" % (artistid),
|
||||
"Status": "Loading"}
|
||||
myDB.upsert("artists", newValueDict, controlValueDict)
|
||||
|
||||
artist = mb.getArtist(artistid, extrasonly)
|
||||
|
||||
@@ -309,4 +317,4 @@ def addReleaseById(rid):
|
||||
logger.error("ReleaseGroup does not exist in the database and did not get a valid response from MB. Skipping release.")
|
||||
return
|
||||
else:
|
||||
logger.info('Release ' + str(rid) + " already exists in the database!")
|
||||
logger.info('Release ' + str(rid) + " already exists in the database!")
|
||||
|
||||
@@ -70,7 +70,6 @@ class WebInterface(object):
|
||||
|
||||
def addArtist(self, artistid):
|
||||
threading.Thread(target=importer.addArtisttoDB, args=[artistid]).start()
|
||||
time.sleep(5)
|
||||
threading.Thread(target=lastfm.getSimilar).start()
|
||||
raise cherrypy.HTTPRedirect("artistPage?ArtistID=%s" % artistid)
|
||||
addArtist.exposed = True
|
||||
@@ -495,4 +494,4 @@ class WebInterface(object):
|
||||
lastfm.getSimilar()
|
||||
raise cherrypy.HTTPRedirect("extras")
|
||||
|
||||
updateCloud.exposed = True
|
||||
updateCloud.exposed = True
|
||||
|
||||
Reference in New Issue
Block a user