aboutsummaryrefslogtreecommitdiff
path: root/lib/libUPnP/patches/0011-platinum-support-video-ratings.patch
blob: c97d6491dae3693f0a2622c7822d1a16daafccc8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
From a650caab79695b0caaef7b860ae59086a335bb30 Mon Sep 17 00:00:00 2001
From: Alasdair Campbell <alcoheca@gmail.com>
Date: Sat, 6 Oct 2012 23:35:52 +0100
Subject: [PATCH 11/24] platinum: support video ratings

---
 lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.h        | 8 +++++---
 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 c50d450..8d9704f 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 d46d1a5..3416112 100644
--- a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp
+++ b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp
@@ -317,6 +317,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>";
@@ -528,6 +535,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
-- 
1.7.11.msysgit.0