I got one challange...
When using Soptify and Tunein we don`t get "icon-id", we get the "icon" with an URL.
So I check now first if the key "icon-id" exist, if not I use "icon" and use the URL.
Works for me so far.
//get current index
$pl_index = $res_json['result']['playlist_cur_index'];
//artwork
if (array_key_exists('icon-id', $res_json['result']['item_loop'][$pl_index])) {
$icon_id = $res_json['result']['item_loop'][$pl_index]['icon-id'];
$image = "http://" . $config[LMS_IP] . ":" . $config[LMS_WEB_PORT] . "/music/".$icon_id."/cover.jpg";
} else {
$image = strstr($res_json['result']['item_loop'][$pl_index]['icon'], 'http');
$image = urldecode($image);
}
Kommentar