Merge pull request #383 from palli81/master

Error 500 when adding an artist
This commit is contained in:
rembo10
2011-12-29 05:00:24 -08:00
3 changed files with 14 additions and 4 deletions

View File

@@ -109,6 +109,9 @@
<%def name="headIncludes()">
<link rel="stylesheet" href="css/data_table.css">
%if artist['Status'] == 'Loading':
<meta http-equiv="refresh" content="5">
%endif
</%def>
<%def name="javascriptIncludes()">
@@ -140,4 +143,4 @@
});
});
</script>
</%def>
</%def>

View File

@@ -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!")

View File

@@ -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