diff --git a/server/server.js b/server/server.js index d2b0e0f6..341ec323 100755 --- a/server/server.js +++ b/server/server.js @@ -327,18 +327,20 @@ function change_song_post(coll) {$match:{now_playing:false}}, {$sort:{votes:-1, added:1}}, {$limit:1}], function(err, docs){ - db.collection(coll).update({id:docs[0]["id"]}, - {$set:{ - now_playing:true, - votes:0, - guids:[], - added:get_time()}}, function(err, docs){ - db.collection(coll).update({views:{$exists:true}}, - {$set:{startTime:get_time()}}, function(err, docs){ - sort_list(coll,undefined,true); - }); + if(docs.length > 0){ + db.collection(coll).update({id:docs[0]["id"]}, + {$set:{ + now_playing:true, + votes:0, + guids:[], + added:get_time()}}, function(err, docs){ + db.collection(coll).update({views:{$exists:true}}, + {$set:{startTime:get_time()}}, function(err, docs){ + sort_list(coll,undefined,true); + }); - }); + }); + } }); } diff --git a/static/js/list.js b/static/js/list.js index e280a2e9..3bb6334a 100755 --- a/static/js/list.js +++ b/static/js/list.js @@ -82,7 +82,7 @@ function populate_list(msg) { player_name = "#jplayer"; }else player_name = "#player"; - $("#playlist").css({height: $(player_name).height()-$("#adminPanel").outerHeight(true)-$("#findform").outerHeight(true)+30}); + $("#playlist").css({height: $(".video-container").height()}); $("#playlist").css({overflow: "hidden"}); if(scroller === false) { diff --git a/static/js/nochan.js b/static/js/nochan.js index 8a866f65..25f1c006 100644 --- a/static/js/nochan.js +++ b/static/js/nochan.js @@ -34,7 +34,6 @@ function populate_channels(lists) card.find(".chan-songs").text(song_count); card.find(".chan-bg").attr("style", img); card.find(".chan-link").attr("href", chan); - output+="