Commit cbfb5395 authored by Konstantin Pavlov's avatar Konstantin Pavlov

UPNP: Attempt to fix #4714. Not tested.

parent 0bbdffbd
...@@ -755,37 +755,16 @@ bool MediaServer::_fetchContents( Container* p_parent ) ...@@ -755,37 +755,16 @@ bool MediaServer::_fetchContents( Container* p_parent )
if ( !objectID ) if ( !objectID )
continue; continue;
const char* childCountStr =
ixmlElement_getAttribute( containerElement, "childCount" );
if ( !childCountStr )
continue;
int childCount = atoi( childCountStr );
const char* title = xml_getChildElementValue( containerElement, const char* title = xml_getChildElementValue( containerElement,
"dc:title" ); "dc:title" );
if ( !title ) if ( !title )
continue; continue;
const char* resource = xml_getChildElementValue( containerElement,
"res" );
if ( resource && childCount < 1 )
{
Item* item = new Item( p_parent, objectID, title, resource, -1 );
p_parent->addItem( item );
}
else
{
Container* container = new Container( p_parent, objectID, title ); Container* container = new Container( p_parent, objectID, title );
p_parent->addContainer( container ); p_parent->addContainer( container );
if ( childCount > 0 )
_fetchContents( container ); _fetchContents( container );
} }
}
ixmlNodeList_free( containerNodeList ); ixmlNodeList_free( containerNodeList );
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment