mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Fixed error when new list is empty
This commit is contained in:
@@ -6,9 +6,11 @@
|
||||
$data = json_decode(file_get_contents($list), true);
|
||||
$songs = $data["nowPlaying"];
|
||||
$id = array_values($songs);
|
||||
if(count($id)>0){
|
||||
$diff = (time() - $data["conf"]["startTime"]);
|
||||
$returnArray = array($diff, $id[0]["id"], time(), $data["conf"]["startTime"], $id[0]["title"], $data["conf"]["views"]);
|
||||
$returnArray = json_encode($returnArray);
|
||||
|
||||
echo $returnArray;
|
||||
}
|
||||
echo("[0,0,0,0,0,0]");
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user