From f031eb1ef22373f94838b7e3357f2913ced6db71 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 10 Jan 2014 10:17:30 +0100 Subject: db/upnp/Directory: parse duration Don't put all attributes to the attributes map; parse the "duration" attribute as soon as we receive it, and store it in an integer attribute. This reduces bloat. --- src/db/upnp/Object.hxx | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/db/upnp/Object.hxx') diff --git a/src/db/upnp/Object.hxx b/src/db/upnp/Object.hxx index a3bb026b8..91a219534 100644 --- a/src/db/upnp/Object.hxx +++ b/src/db/upnp/Object.hxx @@ -58,6 +58,11 @@ public: // The map keys are the XML tag or attribute names. std::map m_props; + /** + * Song duration in seconds. 0 if unknown. + */ + int duration; + /** Get named property * @param property name (e.g. upnp:artist, upnp:album, * upnp:originalTrackNumber, upnp:genre). Use m_title instead @@ -80,6 +85,7 @@ public: type = Type::UNKNOWN; item_class = ItemClass::UNKNOWN; m_props.clear(); + duration = -1; } }; -- cgit v1.2.3