From 8cf382f71a60e073d33d7705f53753bfcd70dc57 Mon Sep 17 00:00:00 2001 From: "Nicolas A. Tonne" Date: Thu, 23 Oct 2014 20:45:57 +0200 Subject: [PATCH] Fixed old lists bugging viewers --- php/change.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/php/change.php b/php/change.php index 7b497142..4986e1b4 100755 --- a/php/change.php +++ b/php/change.php @@ -20,9 +20,13 @@ $np = array_values($np); $firstSong = array_values($songs); $save = false; //declares the save variable, see further down for why - -if(!in_array($guid, $data["conf"]["views"])){ //add viewer in viewers if not already in there - array_push($data["conf"]["views"], $guid); +try{ + if(!in_array($guid, $data["conf"]["views"])){ //add viewer in viewers if not already in there + array_push($data["conf"]["views"], $guid); + file_put_contents($list, json_encode($data)); + } +}catch(Exception $e){ + $data["conf"]["views"]=array($guid); file_put_contents($list, json_encode($data)); }