1 From 77ba91ac8815c150c7e4537a3622df52bd811cef Mon Sep 17 00:00:00 2001
2 From: phate89 <phates89@gmail.com>
3 Date: Sat, 26 Sep 2015 11:16:57 +0200
4 Subject: [PATCH] platinum: add support for multiple ratings
7 .../Platinum/Source/Devices/MediaServer/PltMediaItem.cpp | 11 +++++++----
8 .../Platinum/Source/Devices/MediaServer/PltMediaItem.h | 2 +-
9 2 files changed, 8 insertions(+), 5 deletions(-)
11 diff --git a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp
12 index 01ef6e9..96839e4 100644
13 --- a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp
14 +++ b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp
15 @@ -258,7 +258,7 @@ PLT_MediaObject::Reset()
17 m_XbmcInfo.date_added = "";
18 m_XbmcInfo.rating = 0.0f;
19 - m_XbmcInfo.votes = "";
20 + m_XbmcInfo.votes = 0;
21 m_XbmcInfo.artwork.Clear();
22 m_XbmcInfo.unique_identifier = "";
23 m_XbmcInfo.countries.Clear();
24 @@ -590,9 +590,9 @@ PLT_MediaObject::ToDidl(NPT_UInt64 mask, NPT_String& didl)
28 - if (mask & PLT_FILTER_MASK_XBMC_VOTES && !m_XbmcInfo.votes.IsEmpty()) {
29 + if (mask & PLT_FILTER_MASK_XBMC_VOTES && m_XbmcInfo.votes != 0) {
30 didl += "<xbmc:votes>";
31 - PLT_Didl::AppendXmlEscape(didl, m_XbmcInfo.votes);
32 + didl += NPT_String::Format("%i", m_XbmcInfo.votes);
33 didl += "</xbmc:votes>";
36 @@ -841,7 +841,10 @@ PLT_MediaObject::FromDidl(NPT_XmlElementNode* entry)
37 if (NPT_FAILED(str.ToFloat(floatValue))) floatValue = 0.0;
38 m_XbmcInfo.rating = floatValue;
40 - PLT_XmlHelper::GetChildText(entry, "votes", m_XbmcInfo.votes, didl_namespace_xbmc, 256);
41 + PLT_XmlHelper::GetChildText(entry, "votes", str, didl_namespace_xbmc, 256);
43 + if (NPT_FAILED(str.ToInteger(intValue))) intValue = 0;
44 + m_XbmcInfo.votes = intValue;
47 PLT_XmlHelper::GetChildren(entry, children, "artwork", didl_namespace_xbmc);
48 diff --git a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.h b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.h
49 index 98d47d8..5712b9a 100644
50 --- a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.h
51 +++ b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.h
52 @@ -167,7 +167,7 @@ public:
54 NPT_String date_added;
59 NPT_String unique_identifier;
60 NPT_List<NPT_String> countries;