From 999dff532625afddb93b5f43d221157deac4a88f Mon Sep 17 00:00:00 2001 From: KasperRT Date: Mon, 20 Oct 2014 15:39:30 +0200 Subject: [PATCH] Added delete after play Only deletes if it has been set in the json manually temporarily --- php/change.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/php/change.php b/php/change.php index 0f2ffb16..387c6b7f 100755 --- a/php/change.php +++ b/php/change.php @@ -38,7 +38,12 @@ if(isset($_REQUEST['thisUrl'])){ //array_shift($data["nowPlaying"]); if(!is_null($np[0]["id"]) && !is_null($firstToAdd)){ 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()); + $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"]);