Permalink
Browse files

Fix: Currently playing track was not being updated immediately.

  • Loading branch information...
sharjeelaziz committed Jul 21, 2011
1 parent 0b9f890 commit 30316c30d04a7886af6643b4512daea8a9d0dfc2
Showing with 5 additions and 12 deletions.
  1. +5 −12 googlemusic.js
View
@@ -13,23 +13,16 @@ var CONTAINER_SELECTOR = '#playerSongInfo';
$(function(){
$(CONTAINER_SELECTOR).live('DOMSubtreeModified', function(e) {
- // init ----> loading
- if (state == 'init' && $(CONTAINER_SELECTOR).length > 0) {
- state = 'loading';
- return;
- }
-
- // loading ---> playing
- if (state == 'loading' && $(CONTAINER_SELECTOR).length > 0) {
+
+ if ($(CONTAINER_SELECTOR).length > 0) {
updateNowPlaying();
- state = 'init';
return;
- }
+ }
+
});
// first load
updateNowPlaying();
- state = 'init';
});
/**
@@ -89,7 +82,7 @@ function parseInfo() {
return {artist: artist, track: track, duration : duration};
}
-function parseDuration(artistTitle){
+function parseDuration(artistTitle) {
try {
match = artistTitle.match(/\d+:\d+/g)[0]

0 comments on commit 30316c3

Please sign in to comment.