mirror of
https://github.com/rembo10/headphones.git
synced 2026-05-08 12:49:32 +01:00
Merge pull request #383 from palli81/master
Error 500 when adding an artist
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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