diff options
author | Max Kellermann <max@musicpd.org> | 2020-07-06 21:47:30 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2020-07-06 21:47:30 +0200 |
commit | b74a91427dde2eddcab9d2c6448672dc556187cc (patch) | |
tree | dc90d9cabaa93fa14d4da6b4b4bb3a4a451a4ffd /src/db | |
parent | 9964a5ffe8f12c48c0276d924ced4859c8de2ee0 (diff) | |
parent | c67372f8af0419da2012bae743d96e272594b7f4 (diff) |
Merge tag 'v0.21.25'
release v0.21.25
Diffstat (limited to 'src/db')
-rw-r--r-- | src/db/plugins/upnp/Object.hxx | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/db/plugins/upnp/Object.hxx b/src/db/plugins/upnp/Object.hxx index a9709f869..7a6214467 100644 --- a/src/db/plugins/upnp/Object.hxx +++ b/src/db/plugins/upnp/Object.hxx @@ -90,8 +90,17 @@ public: } gcc_pure + bool IsRoot() const noexcept { + return type == Type::CONTAINER && id == "0"; + } + + gcc_pure bool Check() const noexcept { - return !id.empty() && !parent_id.empty() && !name.empty() && + return !id.empty() && + /* root nodes don't need a parent id and a + name */ + (IsRoot() || (!parent_id.empty() && + !name.empty())) && (type != UPnPDirObject::Type::ITEM || item_class != UPnPDirObject::ItemClass::UNKNOWN); } |