diff options
author | Max Kellermann <max@duempel.org> | 2014-01-14 21:25:43 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-01-14 22:33:18 +0100 |
commit | 676d8bb624ef9fb7a8a4983b258d07787efec6b1 (patch) | |
tree | bd8be367773915125a600ebcb4707ece3f1efa86 /src/db/upnp/Object.hxx | |
parent | 4bcaf5d3064ca8846f8652413b2e0deba80aa624 (diff) | |
download | mpd-676d8bb624ef9fb7a8a4983b258d07787efec6b1.tar.gz mpd-676d8bb624ef9fb7a8a4983b258d07787efec6b1.tar.xz mpd-676d8bb624ef9fb7a8a4983b258d07787efec6b1.zip |
db/upnp/Object: add attribute "tag"
Replaces "m_title" and "m_props". More bloat removed.
Diffstat (limited to '')
-rw-r--r-- | src/db/upnp/Object.hxx | 29 |
1 files changed, 4 insertions, 25 deletions
diff --git a/src/db/upnp/Object.hxx b/src/db/upnp/Object.hxx index 1d32d0401..39b8f94f9 100644 --- a/src/db/upnp/Object.hxx +++ b/src/db/upnp/Object.hxx @@ -20,8 +20,9 @@ #ifndef MPD_UPNP_OBJECT_HXX #define MPD_UPNP_OBJECT_HXX +#include "tag/Tag.hxx" + #include <string> -#include <map> /** * UpnP Media Server directory entry, converted from XML data. @@ -61,43 +62,21 @@ public: std::string m_title; // dc:title. Directory name for a container. Type type; ItemClass item_class; - // Properties as gathered from the XML document (url, artist, etc.) - // The map keys are the XML tag or attribute names. - std::map<std::string, std::string> m_props; - /** - * Song duration in seconds. 0 if unknown. - */ - int duration; + Tag tag; UPnPDirObject() = default; UPnPDirObject(UPnPDirObject &&) = default; UPnPDirObject &operator=(UPnPDirObject &&) = default; - /** Get named property - * @param property name (e.g. upnp:artist, upnp:album, - * upnp:originalTrackNumber, upnp:genre). Use m_title instead - * for dc:title. - * @param[out] value - * @return true if found. - */ - const char *getprop(const char *_name) const { - auto it = m_props.find(_name); - if (it == m_props.end()) - return nullptr; - return it->second.c_str(); - } - void clear() { m_id.clear(); m_pid.clear(); url.clear(); - m_title.clear(); type = Type::UNKNOWN; item_class = ItemClass::UNKNOWN; - m_props.clear(); - duration = -1; + tag.Clear(); } }; |