From 85a21147141e81e911d01da7a7186bb05c427bd0 Mon Sep 17 00:00:00 2001 From: KasperRT Date: Mon, 20 Oct 2014 16:01:23 +0200 Subject: [PATCH 1/4] Updated text on the panel --- php/panel.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/php/panel.php b/php/panel.php index bdf0e912..b1db8c4f 100755 --- a/php/panel.php +++ b/php/panel.php @@ -2,11 +2,11 @@
- - + + - + From 7a55ce3a244d6c6087d69916100ce888bc67cbdd Mon Sep 17 00:00:00 2001 From: KasperRT Date: Mon, 20 Oct 2014 16:22:42 +0200 Subject: [PATCH 2/4] Added resizing for the playlist accordingly --- js/admin.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/admin.js b/js/admin.js index df8dd77a..40f72631 100755 --- a/js/admin.js +++ b/js/admin.js @@ -2,7 +2,10 @@ var adminTogg; function admin() { + adminTogg = !adminTogg; + if(!adminTogg) $("#playlist").height($("#playlist").height()+$("#adminPanel").outerHeight(true)); $("#adminPanel").toggleClass("hiddenAdmin"); + if(adminTogg) $("#playlist").height($("#playlist").height()-$("#adminPanel").outerHeight(true)); } From 9e1e0bda663bfd9334face257b6d698d25d9cc72 Mon Sep 17 00:00:00 2001 From: KasperRT Date: Mon, 20 Oct 2014 16:37:02 +0200 Subject: [PATCH 3/4] List update on adding song List is now updating on adding a song, so the user can see that the song he requested is added "at once" --- js/search.js | 1 + 1 file changed, 1 insertion(+) diff --git a/js/search.js b/js/search.js index 67338d07..e02760cb 100755 --- a/js/search.js +++ b/js/search.js @@ -95,6 +95,7 @@ $(document).ready(function() $("#search").removeClass("success"); $("#search").removeClass("error"); },1500); + updateList(); } // if(reply=="added"){$("#search").removeClass('success'); $("#search").addClass('success');} From cc1d5965ef982449dda0f7d02f88dff1e423ef44 Mon Sep 17 00:00:00 2001 From: KasperRT Date: Tue, 21 Oct 2014 01:39:52 +0200 Subject: [PATCH 4/4] Added delete after skip Same as the delete after play function --- php/change.php | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/php/change.php b/php/change.php index 387c6b7f..588416b3 100755 --- a/php/change.php +++ b/php/change.php @@ -139,18 +139,23 @@ else if(isset($_GET['skip'])){ //skip song request //$data["conf"]["skips"]=$skips; if($skips>=$viewers/2){ array_shift($data["songs"]); - $data["songs"][$np[0]["id"]] = array("id" => $np[0]["id"], "title" => $np[0]["title"], "votes" => $np[0]["votes"], "added" => time(), "guids" => array()); - array_shift($data["nowPlaying"]); - $data["nowPlaying"][$firstSong[0]["id"]] = array("id" => $firstSong[0]["id"], "title" => $firstSong[0]["title"], "votes" => 0, "added" => $firstSong[0]["added"], "guids" => $firstSong[0]["guids"]); - //array_push($data["songs"], $add); - $data["conf"]["skips"] = array(); - $data["conf"]["startTime"] = time(); - $data["conf"]["views"] = 1; - foreach($data["songs"] as $k=>$v) { - $sort['votes'][$k] = $v['votes']; - $sort['added'][$k] = $v['added']; - } - array_multisort($sort['votes'], SORT_DESC, $sort['added'], SORT_ASC, $data["songs"]); + $q = $data["conf"]; + $q = array_key_exists("delsongs", $q); + if(!$data["conf"]["delsongs"] || $q != 1) + { + $data["songs"][$np[0]["id"]] = array("id" => $np[0]["id"], "title" => $np[0]["title"], "votes" => $np[0]["votes"], "added" => time(), "guids" => array()); + } + array_shift($data["nowPlaying"]); + $data["nowPlaying"][$firstSong[0]["id"]] = array("id" => $firstSong[0]["id"], "title" => $firstSong[0]["title"], "votes" => 0, "added" => $firstSong[0]["added"], "guids" => $firstSong[0]["guids"]); + //array_push($data["songs"], $add); + $data["conf"]["skips"] = array(); + $data["conf"]["startTime"] = time(); + $data["conf"]["views"] = 1; + foreach($data["songs"] as $k=>$v) { + $sort['votes'][$k] = $v['votes']; + $sort['added'][$k] = $v['added']; + } + array_multisort($sort['votes'], SORT_DESC, $sort['added'], SORT_ASC, $data["songs"]); } file_put_contents($list, json_encode($data)); }