Skip to content

Commit

Permalink
adapt since noson 1.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
janbar committed Jul 22, 2017
1 parent a0cbda7 commit 6b4392c
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions backend/modules/NosonApp/mediamodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down

0 comments on commit 6b4392c

Please sign in to comment.