From 073899b399acd735849fbe04fa2acfa2befcdf46 Mon Sep 17 00:00:00 2001 From: Afterster Date: Tue, 1 Jul 2014 13:46:39 +0200 Subject: [PATCH] Fix UPnP browse (beautiful url setting required) --- lib/class/upnp_api.class.php | 5 +++-- upnp/control-reply.php | 5 ++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/class/upnp_api.class.php b/lib/class/upnp_api.class.php index 223bb672..c23ed022 100644 --- a/lib/class/upnp_api.class.php +++ b/lib/class/upnp_api.class.php @@ -585,7 +585,7 @@ class Upnp_Api 'childCount' => $album->song_count, 'dc:title' => $album->f_title, 'upnp:class' => 'object.container', - 'upnp:album_art'=> $art_url, + //'upnp:album_art'=> $art_url, ); } @@ -615,6 +615,7 @@ class Upnp_Api { $api_session = (AmpConfig::get('require_session')) ? Stream::$session : false; $art_url = Art::url($song->album, 'album', $api_session); + $fileTypesByExt = self::_getFileTypes(); $arrFileType = $fileTypesByExt[$song->type]; @@ -623,7 +624,7 @@ class Upnp_Api 'parentID' => $parent, 'dc:title' => $song->f_title, 'upnp:class' => (isset($arrFileType['class'])) ? $arrFileType['class'] : 'object.item.unknownItem', - 'upnp:album_art'=> $art_url, + //'upnp:album_art'=> $art_url, 'dc:date' => date("c", $song->addition_time), 'res' => Song::play_url($song->id), 'size' => $song->size, diff --git a/upnp/control-reply.php b/upnp/control-reply.php index 0196b6fe..aec92fbb 100644 --- a/upnp/control-reply.php +++ b/upnp/control-reply.php @@ -7,6 +7,8 @@ if (!AmpConfig::get('upnp_backend')) { exit; } +set_time_limit(600); + header ("Content-Type: text/html; charset=UTF-8"); $rootMediaItems = array(); $rootMediaItems[] = Upnp_Api::_musicMetadata(''); @@ -83,7 +85,7 @@ $rootMediaItems[] = Upnp_Api::_musicMetadata(''); $totMatches = count($items); if ($totMatches == 0) { - $domDIDL = _createDIDL(''); + $domDIDL = Upnp_Api::createDIDL(''); $numRet = 0; } else { if ($upnpRequest['requestedcount'] == 0) { @@ -99,4 +101,5 @@ $rootMediaItems[] = Upnp_Api::_musicMetadata(''); $soapXML = $domSOAP->saveXML(); echo $soapXML; + debug_event('upnp', 'Response: ' . $soapXML, '5'); ?>