fix maybe
This commit is contained in:
parent
7ba32186cf
commit
ce45727b60
1 changed files with 1 additions and 1 deletions
|
|
@ -25,7 +25,7 @@ public function getCurrentTrack() {
|
||||||
$data = $response->json();
|
$data = $response->json();
|
||||||
$track_data = $data["recenttracks"]["track"][0];
|
$track_data = $data["recenttracks"]["track"][0];
|
||||||
// $image = array_column($track_data["image"], null, 'size')['large'] ?? false;
|
// $image = array_column($track_data["image"], null, 'size')['large'] ?? false;
|
||||||
$image = $track_data["image"][(array_key_last($track_data["image"]))] ?? false;
|
$image = end($track_data["image"]) ?? false;
|
||||||
$now_playing = false;
|
$now_playing = false;
|
||||||
if (array_key_exists("@attr", $track_data)) {
|
if (array_key_exists("@attr", $track_data)) {
|
||||||
$now_playing = $track_data["@attr"]["nowplaying"] == "true" ?? ["url"=>null];
|
$now_playing = $track_data["@attr"]["nowplaying"] == "true" ?? ["url"=>null];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue