From 6b4392c445c2182cded494a227bb8a1e096d4562 Mon Sep 17 00:00:00 2001 From: janbar Date: Sat, 22 Jul 2017 19:56:55 +0200 Subject: [PATCH] adapt since noson 1.5.3 --- backend/modules/NosonApp/mediamodel.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/backend/modules/NosonApp/mediamodel.cpp b/backend/modules/NosonApp/mediamodel.cpp index 43fae4d1..81241500 100644 --- a/backend/modules/NosonApp/mediamodel.cpp +++ b/backend/modules/NosonApp/mediamodel.cpp @@ -51,11 +51,16 @@ MediaItem::MediaItem(const SONOS::SMAPIItem& data) m_canQueue = SONOS::System::CanQueueItem(data.uriMetadata); m_objectId = QString::fromUtf8(data.uriMetadata->GetObjectID().c_str()); } + std::string tmp; switch (data.item->subType()) { case SONOS::DigitalItem::SubType_album: m_type = MediaType::album; - m_artist = QString::fromUtf8(data.item->GetValue("dc:creator").c_str()); + tmp = data.item->GetValue("dc:creator"); + if (!tmp.empty()) + m_artist = QString::fromUtf8(tmp.c_str()); + else + m_artist = QString::fromUtf8(data.item->GetValue("dc:contributor").c_str()); m_album = QString::fromUtf8(data.item->GetValue("dc:title").c_str()); break; case SONOS::DigitalItem::SubType_person: @@ -70,7 +75,11 @@ MediaItem::MediaItem(const SONOS::SMAPIItem& data) break; case SONOS::DigitalItem::SubType_audioItem: m_type = MediaType::audioItem; - m_artist = QString::fromUtf8(data.item->GetValue("dc:creator").c_str()); + tmp = data.item->GetValue("dc:creator"); + if (!tmp.empty()) + m_artist = QString::fromUtf8(tmp.c_str()); + else + m_artist = QString::fromUtf8(data.item->GetValue("dc:contributor").c_str()); m_album = QString::fromUtf8(data.item->GetValue("upnp:album").c_str()); break; case SONOS::DigitalItem::SubType_storageFolder: