|
a/libupnpp/cdircontent.cxx |
|
b/libupnpp/cdircontent.cxx |
|
... |
|
... |
32 |
class UPnPDirParser : public expatmm::inputRefXMLParser {
|
32 |
class UPnPDirParser : public expatmm::inputRefXMLParser {
|
33 |
public:
|
33 |
public:
|
34 |
UPnPDirParser(UPnPDirContent& dir, const string& input)
|
34 |
UPnPDirParser(UPnPDirContent& dir, const string& input)
|
35 |
: inputRefXMLParser(input), m_dir(dir)
|
35 |
: inputRefXMLParser(input), m_dir(dir)
|
36 |
{
|
36 |
{
|
|
|
37 |
//LOGDEB("UPnPDirParser: input: " << input << endl);
|
37 |
m_okitems["object.item.audioItem.musicTrack"] =
|
38 |
m_okitems["object.item.audioItem.musicTrack"] =
|
38 |
UPnPDirObject::audioItem_musicTrack;
|
39 |
UPnPDirObject::audioItem_musicTrack;
|
39 |
m_okitems["object.item.playlistItem"] =
|
40 |
m_okitems["object.item.playlistItem"] =
|
40 |
UPnPDirObject::audioItem_playlist;
|
41 |
UPnPDirObject::audioItem_playlist;
|
41 |
}
|
42 |
}
|
|
... |
|
... |
99 |
}
|
100 |
}
|
100 |
|
101 |
|
101 |
if (!ok) {
|
102 |
if (!ok) {
|
102 |
LOGINF("checkobjok:skip: id ["<< m_tobj.m_id<<"] pid ["<<
|
103 |
LOGINF("checkobjok:skip: id ["<< m_tobj.m_id<<"] pid ["<<
|
103 |
m_tobj.m_pid << "] clss [" << m_tobj.m_props["upnp:class"]
|
104 |
m_tobj.m_pid << "] clss [" << m_tobj.m_props["upnp:class"]
|
104 |
<< "] tt [" << m_tobj.m_title << endl);
|
105 |
<< "] tt [" << m_tobj.m_title << "]" << endl);
|
105 |
}
|
106 |
}
|
106 |
return ok;
|
107 |
return ok;
|
107 |
}
|
108 |
}
|
108 |
|
109 |
|
109 |
virtual void EndElement(const XML_Char *name)
|
110 |
virtual void EndElement(const XML_Char *name)
|
|
... |
|
... |
113 |
parentname = "root";
|
114 |
parentname = "root";
|
114 |
} else {
|
115 |
} else {
|
115 |
parentname = m_path[m_path.size()-2].name;
|
116 |
parentname = m_path[m_path.size()-2].name;
|
116 |
}
|
117 |
}
|
117 |
//LOGDEB("Closing element " << name << " inside element " <<
|
118 |
//LOGDEB("Closing element " << name << " inside element " <<
|
118 |
// parentname << endl);
|
119 |
// parentname << " data " << m_path.back().data << endl);
|
119 |
if (!strcmp(name, "container")) {
|
120 |
if (!strcmp(name, "container")) {
|
120 |
if (checkobjok()) {
|
121 |
if (checkobjok()) {
|
121 |
m_dir.m_containers.push_back(m_tobj);
|
122 |
m_dir.m_containers.push_back(m_tobj);
|
122 |
}
|
123 |
}
|
123 |
} else if (!strcmp(name, "item")) {
|
124 |
} else if (!strcmp(name, "item")) {
|
124 |
if (checkobjok()) {
|
125 |
if (checkobjok()) {
|
125 |
m_dir.m_items.push_back(m_tobj);
|
126 |
m_dir.m_items.push_back(m_tobj);
|
126 |
}
|
127 |
}
|
127 |
} else if (!parentname.compare("item")) {
|
128 |
} else if (!parentname.compare("item") ||
|
|
|
129 |
!parentname.compare("container")) {
|
128 |
switch (name[0]) {
|
130 |
switch (name[0]) {
|
129 |
case 'd':
|
131 |
case 'd':
|
130 |
if (!strcmp(name, "dc:title"))
|
132 |
if (!strcmp(name, "dc:title"))
|
131 |
m_tobj.m_title = m_path.back().data;
|
133 |
m_tobj.m_title = m_path.back().data;
|
132 |
break;
|
134 |
break;
|