diff --git a/data/interfaces/default/artist.html b/data/interfaces/default/artist.html
index 423fa014..beb3695d 100644
--- a/data/interfaces/default/artist.html
+++ b/data/interfaces/default/artist.html
@@ -42,14 +42,8 @@
-
- %if artist['Status'] == 'Loading':
-
- %endif
+
${artist['ArtistName']}
- %if artist['Status'] == 'Loading':
- (Album information for this artist is currently being loaded)
- %endif
@@ -156,9 +150,6 @@
<%def name="headIncludes()">
- %if artist['Status'] == 'Loading':
-
- %endif
%def>
<%def name="javascriptIncludes()">
@@ -171,7 +162,6 @@
getInfo(elem,id,'artist');
}
-
<%
if headphones.SONGKICK_FILTER_ENABLED:
songkick_filter_enabled = "true"
@@ -240,6 +230,41 @@
});
}
+ var loadingMessage = false;
+ var spinner_active = false;
+ var loadingtext_active = false;
+
+ function checkArtistStatus() {
+ $.ajax({
+ url: "getArtistStatus?ArtistID=${artist['ArtistID']}",
+ complete: function(result) {
+ if (result.responseText == "Loading"){
+ refreshTable();
+ if (loadingMessage == false){
+ showMsg("Getting artist information",true);
+ loadingMessage = true;
+ }
+ if (spinner_active == false){
+ $('#artistname').prepend('')
+ spinner_active = true;
+ }
+ if (loadingtext_active == false){
+ $('#artistname').append('(Album information for this artist is currently being loaded)
')
+ loadingtext_active = true;
+ }
+ }
+ else{
+ $('#artistnamespinner').remove()
+ $('#loadingtext').remove()
+ $('#ajaxMsg').remove()
+ spinner_active = false
+ loadingtext_active = false
+ loadingMessage = false
+ }
+ }
+ });
+ }
+
function initThisPage() {
$('#menu_link_getextra').click(function() {
$('#dialog').dialog();
@@ -248,10 +273,6 @@
$('#menu_link_modifyextra').click(function() {
$('#dialog').dialog();
});
-
- %if artist['Status'] == 'Loading':
- showMsg("Getting artist information",true);
- %endif
$('#album_table').dataTable({
"bDestroy": true,
"aoColumns": [
@@ -291,8 +312,12 @@
initThisPage();
getArtistBio();
if( ${songkick_enabled} ){
- getArtistsCalendar();
- }
+ getArtistsCalendar();
+ }
+ checkArtistStatus();
+ setInterval(function(){
+ checkArtistStatus();
+ }, 3000);
});
diff --git a/headphones/webserve.py b/headphones/webserve.py
index 39ddb88f..81b06f8a 100644
--- a/headphones/webserve.py
+++ b/headphones/webserve.py
@@ -854,6 +854,12 @@ class WebInterface(object):
return json_albums
getAlbumsByArtist_json.exposed=True
+ def getArtistStatus(self, ArtistID):
+ myDB = db.DBConnection()
+ artist = myDB.action('SELECT Status FROM artists WHERE ArtistID=?', [ArtistID]).fetchone()
+ return artist['Status']
+ getArtistStatus.exposed=True
+
def clearhistory(self, type=None, date_added=None, title=None):
myDB = db.DBConnection()
if type: