Fixed old lists bugging viewers

This commit is contained in:
Nicolas A. Tonne
2014-10-23 20:45:57 +02:00
parent f04f5ba500
commit 8cf382f71a

View File

@@ -20,11 +20,15 @@ $np = array_values($np);
$firstSong = array_values($songs); $firstSong = array_values($songs);
$save = false; //declares the save variable, see further down for why $save = false; //declares the save variable, see further down for why
try{
if(!in_array($guid, $data["conf"]["views"])){ //add viewer in viewers if not already in there if(!in_array($guid, $data["conf"]["views"])){ //add viewer in viewers if not already in there
array_push($data["conf"]["views"], $guid); array_push($data["conf"]["views"], $guid);
file_put_contents($list, json_encode($data)); file_put_contents($list, json_encode($data));
} }
}catch(Exception $e){
$data["conf"]["views"]=array($guid);
file_put_contents($list, json_encode($data));
}
//If test for either saving when the song is done, or an error has occured //If test for either saving when the song is done, or an error has occured
if(isset($_REQUEST['thisUrl'])){ if(isset($_REQUEST['thisUrl'])){