radamant/robut-rdio — Issue #3: Now Playing - reports the track twice into the chat room
Author: burtlo
Created: 2011-11-25 10:58:22+00:00
State: open

```javascript
callback.playingTrackChanged = function(playingTrack, sourcePosition) {
if (playingTrack) {
var title = callback.sourceTitle(playingTrack);
$('#now_playing li').removeClass('playing');
$('#now_playing li').eq(sourcePosition).addClass('playing');
$('title').html(title + " - Powered by Rdio");
$('#current_track').show().html("Now Playing: " + title);
$.ajax({
url: '/now_playing/' + escape(title),
dataType: 'json'
});
} else {
$('#current_track').hide();
}
}
```

This block seems to be called twice whenever a track changes.