spacevillain (spacevillain) wrote in changelog,
spacevillain
spacevillain
changelog

[livejournal] r23203: LJSUP-14062: Music field auto-fills with...

Committer: atyurin
LJSUP-14062: Music field auto-fills with "Loading..."
U   trunk/htdocs/js/lastfm.js
Modified: trunk/htdocs/js/lastfm.js
===================================================================
--- trunk/htdocs/js/lastfm.js	2012-10-26 09:01:32 UTC (rev 23202)
+++ trunk/htdocs/js/lastfm.js	2012-10-26 11:08:38 UTC (rev 23203)
@@ -15,10 +15,15 @@
             data: {
                 method: 'user.getrecenttracks',
                 user: user,
-                api_key: 'b25b959554ed76058ac220b7b2e0a026',
+                api_key: Site.page.last_fm_api_key,
                 format: 'json'
             }
         }).done(function(res) {
+            if (res.error) {
+                console.error('Last.FM error: ' + res.message);
+                return;
+            }
+
             var tracks = res.recenttracks,
                 last = tracks && tracks.track[0],
                 nowPlaying = null,
@@ -53,6 +58,7 @@
 
     var user = Site.page.last_fm_user;
     if (!user) {
+        console.error('No last.fm user');
         return;
     }
 

Tags: atyurin, js, livejournal, spacevillain
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments