mirror of
https://github.com/KevinMidboe/zoff.git
synced 2026-01-03 08:05:34 +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);
|
$data = json_decode(file_get_contents($list), true);
|
||||||
$songs = $data["nowPlaying"];
|
$songs = $data["nowPlaying"];
|
||||||
$id = array_values($songs);
|
$id = array_values($songs);
|
||||||
$diff = (time() - $data["conf"]["startTime"]);
|
if(count($id)>0){
|
||||||
$returnArray = array($diff, $id[0]["id"], time(), $data["conf"]["startTime"], $id[0]["title"], $data["conf"]["views"]);
|
$diff = (time() - $data["conf"]["startTime"]);
|
||||||
$returnArray = json_encode($returnArray);
|
$returnArray = array($diff, $id[0]["id"], time(), $data["conf"]["startTime"], $id[0]["title"], $data["conf"]["views"]);
|
||||||
|
$returnArray = json_encode($returnArray);
|
||||||
echo $returnArray;
|
echo $returnArray;
|
||||||
|
}
|
||||||
|
echo("[0,0,0,0,0,0]");
|
||||||
?>
|
?>
|
||||||
|
|||||||
Reference in New Issue
Block a user