diff options
author | Alasdair Campbell <alcoheca@gmail.com> | 2012-10-06 23:35:52 +0100 |
---|---|---|
committer | Alasdair Campbell <alcoheca@gmail.com> | 2012-10-11 02:26:29 +0100 |
commit | e2f1b7ae2ede609c590ca492b0196317080fc866 (patch) | |
tree | 1579372673b333fcb5150ff9acf8f3886bcb943d /lib | |
parent | cd59b5e0061d60048a3e0bc7cf4c867049fb0520 (diff) |
[UPnP] support video ratings
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.h | 8 | ||||
-rw-r--r-- | lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp | 8 |
2 files changed, 13 insertions, 3 deletions
diff --git a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.h b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.h index c50d450913..8d9704ffb6 100644 --- a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.h +++ b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.h @@ -80,10 +80,11 @@ #define PLT_FILTER_MASK_LONGDESCRIPTION 0x04000000 #define PLT_FILTER_MASK_ICON 0x08000000 +#define PLT_FILTER_MASK_RATING 0x10000000 -#define PLT_FILTER_MASK_TOC 0x10000000 -#define PLT_FILTER_MASK_SEARCHCLASS 0x20000000 -#define PLT_FILTER_MASK_REFID 0x40000000 +#define PLT_FILTER_MASK_TOC 0x20000000 +#define PLT_FILTER_MASK_SEARCHCLASS 0x40000000 +#define PLT_FILTER_MASK_REFID 0x80000000 #define PLT_FILTER_FIELD_TITLE "dc:title" #define PLT_FILTER_FIELD_CREATOR "dc:creator" @@ -99,6 +100,7 @@ #define PLT_FILTER_FIELD_DESCRIPTION "dc:description" #define PLT_FILTER_FIELD_LONGDESCRIPTION "upnp:longDescription" #define PLT_FILTER_FIELD_ICON "upnp:icon" +#define PLT_FILTER_FIELD_RATING "upnp:rating" #define PLT_FILTER_FIELD_ORIGINALTRACK "upnp:originalTrackNumber" #define PLT_FILTER_FIELD_PROGRAMTITLE "upnp:programTitle" #define PLT_FILTER_FIELD_SERIESTITLE "upnp:seriesTitle" diff --git a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp index 64437d21fd..0a55eef8e7 100644 --- a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp +++ b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp @@ -318,6 +318,13 @@ PLT_MediaObject::ToDidl(NPT_UInt32 mask, NPT_String& didl) didl += "</upnp:icon>"; } + // rating + if ((mask & PLT_FILTER_MASK_RATING) && !m_Description.rating.IsEmpty()) { + didl += "<upnp:rating>"; + PLT_Didl::AppendXmlEscape(didl, m_Description.rating); + didl += "</upnp:rating>"; + } + // original track number if ((mask & PLT_FILTER_MASK_ORIGINALTRACK) && m_MiscInfo.original_track_number > 0) { didl += "<upnp:originalTrackNumber>"; @@ -529,6 +536,7 @@ PLT_MediaObject::FromDidl(NPT_XmlElementNode* entry) PLT_XmlHelper::GetChildText(entry, "description", m_Description.description, didl_namespace_dc); PLT_XmlHelper::GetChildText(entry, "longDescription", m_Description.long_description, didl_namespace_upnp); PLT_XmlHelper::GetChildText(entry, "icon", m_Description.icon_uri, didl_namespace_upnp); + PLT_XmlHelper::GetChildText(entry, "rating", m_Description.rating, didl_namespace_upnp); PLT_XmlHelper::GetChildText(entry, "toc", m_MiscInfo.toc, didl_namespace_upnp); // album arts |