Skip to content

Commit

Permalink
Move scrobbling cap check to only run on authed responses
Browse files Browse the repository at this point in the history
  • Loading branch information
jwheare committed Jun 15, 2009
1 parent 282e961 commit c2767a7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions lib/playdar.js
Expand Up @@ -144,14 +144,14 @@ Playdar.Client.prototype = {
new Playdar.StatusBar();
Playdar.status_bar.handle_stat(response);
}
// Setup scrobbling if we haven't already, if it's enabled globally and if the daemon
// has it enabled
if (!Playdar.scrobbler && Playdar.USE_SCROBBLER && response.capabilities.audioscrobbler) {
new Playdar.Scrobbler();
}
this.listeners.onStat(response);

if (response.authenticated) {
// Setup scrobbling if we haven't already, if it's enabled globally
// and if the daemon has it enabled
if (!Playdar.scrobbler && Playdar.USE_SCROBBLER && response.capabilities.audioscrobbler) {
new Playdar.Scrobbler();
}
this.listeners.onAuth();
} else if (this.auth_token) {
this.clear_auth();
Expand Down
6 changes: 3 additions & 3 deletions lib/playdar_compressed.js
Expand Up @@ -77,6 +77,9 @@ Playdar.status_bar.handle_stat(_10);
}
this.listeners.onStat(_10);
if(_10.authenticated){
if(!Playdar.scrobbler&&Playdar.USE_SCROBBLER&&_10.capabilities.audioscrobbler){
new Playdar.Scrobbler();
}
this.listeners.onAuth();
}else{
if(this.auth_token){
Expand Down Expand Up @@ -378,9 +381,6 @@ Playdar.player=this;
this.streams={};
this.nowplayingid=null;
this.soundmanager=_58;
if(Playdar.USE_SCROBBLER){
new Playdar.Scrobbler();
}
};
Playdar.Player.prototype={register_stream:function(_59,_5a){
this.streams[_59.sid]=_59;
Expand Down

0 comments on commit c2767a7

Please sign in to comment.