|
a/src/upmpd.cxx |
|
b/src/upmpd.cxx |
|
... |
|
... |
127 |
m_mpds = &m_mpdcli->getStatus();
|
127 |
m_mpds = &m_mpdcli->getStatus();
|
128 |
return *m_mpds;
|
128 |
return *m_mpds;
|
129 |
}
|
129 |
}
|
130 |
|
130 |
|
131 |
bool UpMpd::checkContentFormat(const string& uri, const string& didl,
|
131 |
bool UpMpd::checkContentFormat(const string& uri, const string& didl,
|
132 |
UpSong *ups)
|
132 |
UpSong *ups, bool p_nocheck)
|
133 |
{
|
133 |
{
|
|
|
134 |
bool nocheck = (m_options & upmpdNoContentFormatCheck) || p_nocheck;
|
134 |
UPnPClient::UPnPDirContent dirc;
|
135 |
UPnPClient::UPnPDirContent dirc;
|
135 |
if (!dirc.parse(didl) || dirc.m_items.size() == 0) {
|
136 |
if (!dirc.parse(didl) || dirc.m_items.size() == 0) {
|
136 |
if (!didl.empty()) {
|
137 |
if (!didl.empty()) {
|
137 |
LOGERR("checkContentFormat: didl parse failed\n");
|
138 |
LOGERR("checkContentFormat: didl parse failed\n");
|
138 |
}
|
139 |
}
|
139 |
if ((m_options & upmpdNoContentFormatCheck)) {
|
140 |
if (nocheck) {
|
140 |
noMetaUpSong(ups);
|
141 |
noMetaUpSong(ups);
|
141 |
return true;
|
142 |
return true;
|
142 |
} else {
|
143 |
} else {
|
143 |
return false;
|
144 |
return false;
|
144 |
}
|
145 |
}
|
145 |
}
|
146 |
}
|
146 |
UPnPClient::UPnPDirObject& dobj = *dirc.m_items.begin();
|
147 |
UPnPClient::UPnPDirObject& dobj = *dirc.m_items.begin();
|
147 |
|
148 |
|
148 |
if ((m_options & upmpdNoContentFormatCheck)) {
|
149 |
if (nocheck) {
|
149 |
LOGINFO("checkContentFormat: format check disabled\n");
|
150 |
LOGINFO("checkContentFormat: format check disabled\n");
|
150 |
return dirObjToUpSong(dobj, ups);
|
151 |
return dirObjToUpSong(dobj, ups);
|
151 |
}
|
152 |
}
|
152 |
|
153 |
|
153 |
const std::unordered_set<std::string>& supportedformats =
|
154 |
const std::unordered_set<std::string>& supportedformats =
|