diff options
author | Max Kellermann <max@duempel.org> | 2014-01-13 22:23:00 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-01-13 22:23:00 +0100 |
commit | 85324f80fe1d72a066cc49847815830080eb1bc3 (patch) | |
tree | 12823ab3d800583600cc1dc485cb84f3b3740ba8 /src/db/upnp | |
parent | 56a7fcf189b904a9d1f6e96f7efa0233c742190a (diff) | |
download | mpd-85324f80fe1d72a066cc49847815830080eb1bc3.tar.gz mpd-85324f80fe1d72a066cc49847815830080eb1bc3.tar.xz mpd-85324f80fe1d72a066cc49847815830080eb1bc3.zip |
db/upnp: fix "upnp:class" parser
"upnp:class" is an element, not an attribute of element "item". This
fixes a regression from commit 65ebfb16
Diffstat (limited to 'src/db/upnp')
-rw-r--r-- | src/db/upnp/Directory.cxx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/db/upnp/Directory.cxx b/src/db/upnp/Directory.cxx index a42719e4d..3b75eceda 100644 --- a/src/db/upnp/Directory.cxx +++ b/src/db/upnp/Directory.cxx @@ -104,12 +104,6 @@ protected: const char *pid = GetAttribute(attrs, "parentID"); if (pid != nullptr) m_tobj.m_pid = pid; - - const char *item_class_name = - GetAttribute(attrs, "upnp:class"); - if (item_class_name != nullptr) - m_tobj.item_class = - ParseItemClass(item_class_name); } break; @@ -132,7 +126,8 @@ protected: bool checkobjok() { if (m_tobj.m_id.empty() || m_tobj.m_pid.empty() || m_tobj.m_title.empty() || - m_tobj.item_class == UPnPDirObject::ItemClass::UNKNOWN) + (m_tobj.type == UPnPDirObject::Type::ITEM && + m_tobj.item_class == UPnPDirObject::ItemClass::UNKNOWN)) return false; return true; @@ -168,6 +163,11 @@ protected: } break; case 'u': + if (m_path.back() == "upnp:class") { + m_tobj.item_class = ParseItemClass(str.c_str()); + break; + } + for (auto i = upnptags; *i != nullptr; ++i) if (!m_path.back().compare(*i)) m_tobj.m_props[*i] += str; |