From: Luigi Pinca Date: Sun, 7 Apr 2013 22:22:21 +0000 (+0200) Subject: fixed a bug introduced in commit 30cec4c X-Git-Url: https://git.saalbach.dev/?a=commitdiff_plain;h=7b6daa025e29d3d1e6356b7c3b9ae777e7f273a3;p=binbsis50.git fixed a bug introduced in commit 30cec4c --- diff --git a/lib/room.js b/lib/room.js index ab5ebf5..ac71a5f 100644 --- a/lib/room.js +++ b/lib/room.js @@ -335,13 +335,14 @@ function Room(roomname) { var sendLoadTrack = function() { var index = randInt(trackscount[roomname]); songsdb.zrange(roomname, index, index, function(err, res) { + var id = res[0]; // Check if extracted track is in the list of already played tracks - if (~playedtracks.indexOf(res)) { + if (~playedtracks.indexOf(id)) { return sendLoadTrack(); } - playedtracks.push(res); + playedtracks.push(id); var args = [ - 'song:'+res + 'song:'+id , 'artistName' , 'trackName' , 'previewUrl' diff --git a/package.json b/package.json index dff585f..4143b35 100644 --- a/package.json +++ b/package.json @@ -24,5 +24,5 @@ "start": "node app.js" }, "subdomain": "binb", - "version": "0.3.5-16" + "version": "0.3.5-17" } diff --git a/routes/site.js b/routes/site.js index a6c77db..b702608 100644 --- a/routes/site.js +++ b/routes/site.js @@ -19,7 +19,7 @@ var subTask = function(genre) { return function(callback) { var index = randInt(trackscount[genre]); db.zrange(genre, index, index, function(err, res) { - db.hget('song:'+res, 'artworkUrl100', callback); + db.hget('song:'+res[0], 'artworkUrl100', callback); }); }; };