From 44a65fc5de15e793cdf261081481c3a357652fe6 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 11 Jan 2014 01:36:08 +0100 Subject: db/upnp/Object: add attribute "url" Don't store in the std::map. --- src/db/UpnpDatabasePlugin.cxx | 2 +- src/db/upnp/Directory.cxx | 2 +- src/db/upnp/Object.hxx | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/db/UpnpDatabasePlugin.cxx b/src/db/UpnpDatabasePlugin.cxx index 5228d8b60..68a24cb4f 100644 --- a/src/db/UpnpDatabasePlugin.cxx +++ b/src/db/UpnpDatabasePlugin.cxx @@ -237,7 +237,7 @@ static Song * upnpItemToSong(const UPnPDirObject &dirent, const char *uri) { if (*uri == 0) - uri = dirent.getprop("url"); + uri = dirent.url.c_str(); Song *s = Song::NewFile(uri, nullptr); diff --git a/src/db/upnp/Directory.cxx b/src/db/upnp/Directory.cxx index 8930890f3..ecb11ab45 100644 --- a/src/db/upnp/Directory.cxx +++ b/src/db/upnp/Directory.cxx @@ -168,7 +168,7 @@ protected: break; case 'r': if (!m_path.back().compare("res")) { - m_tobj.m_props["url"] += str; + m_tobj.url = str; } break; case 'u': diff --git a/src/db/upnp/Object.hxx b/src/db/upnp/Object.hxx index 91a219534..d158ab6f7 100644 --- a/src/db/upnp/Object.hxx +++ b/src/db/upnp/Object.hxx @@ -51,6 +51,7 @@ public: std::string m_id; // ObjectId std::string m_pid; // Parent ObjectId + std::string url; std::string m_title; // dc:title. Directory name for a container. Type type; ItemClass item_class; @@ -81,6 +82,7 @@ public: { m_id.clear(); m_pid.clear(); + url.clear(); m_title.clear(); type = Type::UNKNOWN; item_class = ItemClass::UNKNOWN; -- cgit v1.2.3