1 From a650caab79695b0caaef7b860ae59086a335bb30 Mon Sep 17 00:00:00 2001
2 From: Alasdair Campbell <alcoheca@gmail.com>
3 Date: Sat, 6 Oct 2012 23:35:52 +0100
4 Subject: [PATCH 11/24] platinum: support video ratings
7 lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.h | 8 +++++---
8 lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp | 8 ++++++++
9 2 files changed, 13 insertions(+), 3 deletions(-)
11 diff --git a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.h b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.h
12 index c50d450..8d9704f 100644
13 --- a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.h
14 +++ b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.h
17 #define PLT_FILTER_MASK_LONGDESCRIPTION 0x04000000
18 #define PLT_FILTER_MASK_ICON 0x08000000
19 +#define PLT_FILTER_MASK_RATING 0x10000000
21 -#define PLT_FILTER_MASK_TOC 0x10000000
22 -#define PLT_FILTER_MASK_SEARCHCLASS 0x20000000
23 -#define PLT_FILTER_MASK_REFID 0x40000000
24 +#define PLT_FILTER_MASK_TOC 0x20000000
25 +#define PLT_FILTER_MASK_SEARCHCLASS 0x40000000
26 +#define PLT_FILTER_MASK_REFID 0x80000000
28 #define PLT_FILTER_FIELD_TITLE "dc:title"
29 #define PLT_FILTER_FIELD_CREATOR "dc:creator"
31 #define PLT_FILTER_FIELD_DESCRIPTION "dc:description"
32 #define PLT_FILTER_FIELD_LONGDESCRIPTION "upnp:longDescription"
33 #define PLT_FILTER_FIELD_ICON "upnp:icon"
34 +#define PLT_FILTER_FIELD_RATING "upnp:rating"
35 #define PLT_FILTER_FIELD_ORIGINALTRACK "upnp:originalTrackNumber"
36 #define PLT_FILTER_FIELD_PROGRAMTITLE "upnp:programTitle"
37 #define PLT_FILTER_FIELD_SERIESTITLE "upnp:seriesTitle"
38 diff --git a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp
39 index d46d1a5..3416112 100644
40 --- a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp
41 +++ b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp
42 @@ -317,6 +317,13 @@ PLT_MediaObject::ToDidl(NPT_UInt32 mask, NPT_String& didl)
43 didl += "</upnp:icon>";
47 + if ((mask & PLT_FILTER_MASK_RATING) && !m_Description.rating.IsEmpty()) {
48 + didl += "<upnp:rating>";
49 + PLT_Didl::AppendXmlEscape(didl, m_Description.rating);
50 + didl += "</upnp:rating>";
53 // original track number
54 if ((mask & PLT_FILTER_MASK_ORIGINALTRACK) && m_MiscInfo.original_track_number > 0) {
55 didl += "<upnp:originalTrackNumber>";
56 @@ -528,6 +535,7 @@ PLT_MediaObject::FromDidl(NPT_XmlElementNode* entry)
57 PLT_XmlHelper::GetChildText(entry, "description", m_Description.description, didl_namespace_dc);
58 PLT_XmlHelper::GetChildText(entry, "longDescription", m_Description.long_description, didl_namespace_upnp);
59 PLT_XmlHelper::GetChildText(entry, "icon", m_Description.icon_uri, didl_namespace_upnp);
60 + PLT_XmlHelper::GetChildText(entry, "rating", m_Description.rating, didl_namespace_upnp);
61 PLT_XmlHelper::GetChildText(entry, "toc", m_MiscInfo.toc, didl_namespace_upnp);