Merge pull request #25959 from neo1973/TagLib_deprecation_warnings
[xbmc.git] / lib / libUPnP / patches / 0037-platinum-add-xbmc-userrating-for-user-ratings.patch
blobe969b2d22ddd915cbaabca5ca5c3d6bb3c8482a8
1 From 6a10f12a22b3210beb18d09b11315cdd87a8c6eb Mon Sep 17 00:00:00 2001
2 From: montellese <montellese@xbmc.org>
3 Date: Mon, 14 Sep 2015 08:40:15 +0200
4 Subject: [PATCH 1/3] platinum: add xbmc:userrating for user ratings
6 ---
7 lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.cpp | 2 ++
8 lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.h | 2 ++
9 lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp | 8 ++++++++
10 lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.h | 1 +
11 .../Platinum/Source/Devices/MediaServer/PltSyncMediaBrowser.h | 2 +-
12 5 files changed, 14 insertions(+), 1 deletion(-)
14 diff --git a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.cpp b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.cpp
15 index 0f24ab3..b1ba66f 100644
16 --- a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.cpp
17 +++ b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.cpp
18 @@ -175,6 +175,8 @@ PLT_Didl::ConvertFilterToMask(const NPT_String& filter)
19 mask |= PLT_FILTER_MASK_XBMC_UNIQUE_IDENTIFIER;
20 } else if (NPT_String::CompareN(s + i, PLT_FILTER_FIELD_XBMC_COUNTRY, len, true) == 0) {
21 mask |= PLT_FILTER_MASK_XBMC_COUNTRY;
22 + } else if (NPT_String::CompareN(s + i, PLT_FILTER_FIELD_XBMC_USERRATING, len, true) == 0) {
23 + mask |= PLT_FILTER_MASK_XBMC_USERRATING;
26 if (next_comma < 0) {
27 diff --git a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.h b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.h
28 index 49b92d0..1705f9c 100644
29 --- a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.h
30 +++ b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.h
31 @@ -101,6 +101,7 @@
32 #define PLT_FILTER_MASK_XBMC_ARTWORK NPT_UINT64_C(0x0000800000000000)
33 #define PLT_FILTER_MASK_XBMC_UNIQUE_IDENTIFIER NPT_UINT64_C(0x0001000000000000)
34 #define PLT_FILTER_MASK_XBMC_COUNTRY NPT_UINT64_C(0x0002000000000000)
35 +#define PLT_FILTER_MASK_XBMC_USERRATING NPT_UINT64_C(0x0004000000000000)
37 #define PLT_FILTER_FIELD_TITLE "dc:title"
38 #define PLT_FILTER_FIELD_CREATOR "dc:creator"
39 @@ -152,6 +153,7 @@
40 #define PLT_FILTER_FIELD_XBMC_ARTWORK "xbmc:artwork"
41 #define PLT_FILTER_FIELD_XBMC_UNIQUE_IDENTIFIER "xbmc:uniqueidentifier"
42 #define PLT_FILTER_FIELD_XBMC_COUNTRY "xbmc:country"
43 +#define PLT_FILTER_FIELD_XBMC_USERRATING "xbmc:userrating"
45 extern const char* didl_header;
46 extern const char* didl_footer;
47 diff --git a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp
48 index 2e7d32b..01ef6e9 100644
49 --- a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp
50 +++ b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp
51 @@ -262,6 +262,7 @@ PLT_MediaObject::Reset()
52 m_XbmcInfo.artwork.Clear();
53 m_XbmcInfo.unique_identifier = "";
54 m_XbmcInfo.countries.Clear();
55 + m_XbmcInfo.user_rating = 0;
57 m_Didl = "";
59 @@ -617,6 +618,13 @@ PLT_MediaObject::ToDidl(NPT_UInt64 mask, NPT_String& didl)
63 + // user rating
64 + if (mask & PLT_FILTER_MASK_XBMC_USERRATING) {
65 + didl += "<xbmc:userrating>";
66 + didl += NPT_String::FromInteger(m_XbmcInfo.user_rating);
67 + didl += "</xbmc:userrating>";
68 + }
70 // class is required
71 didl += "<upnp:class";
72 if (!m_ObjectClass.friendly_name.IsEmpty()) {
73 diff --git a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.h b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.h
74 index 0efd505..98d47d8 100644
75 --- a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.h
76 +++ b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.h
77 @@ -171,6 +171,7 @@ typedef struct {
78 PLT_Artworks artwork;
79 NPT_String unique_identifier;
80 NPT_List<NPT_String> countries;
81 + NPT_Int32 user_rating;
82 } PLT_XbmcInfo;
84 typedef struct {
85 diff --git a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltSyncMediaBrowser.h b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltSyncMediaBrowser.h
86 index 9b25d58..e52fb5a 100644
87 --- a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltSyncMediaBrowser.h
88 +++ b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltSyncMediaBrowser.h
89 @@ -70,7 +70,7 @@ typedef struct PLT_CapabilitiesData {
90 typedef NPT_Reference<PLT_CapabilitiesData> PLT_CapabilitiesDataReference;
92 // explicitely specify res otherwise WMP won't return a URL!
93 -#define PLT_DEFAULT_FILTER "dc:date,dc:description,upnp:longDescription,upnp:genre,res,res@duration,res@size,upnp:albumArtURI,upnp:rating,upnp:lastPlaybackPosition,upnp:lastPlaybackTime,upnp:playbackCount,upnp:originalTrackNumber,upnp:episodeNumber,upnp:programTitle,upnp:seriesTitle,upnp:album,upnp:artist,upnp:author,upnp:director,dc:publisher,searchable,childCount,dc:title,dc:creator,upnp:actor,res@resolution,upnp:episodeCount,upnp:episodeSeason,xbmc:dateadded,xbmc:rating,xbmc:votes,xbmc:artwork,xbmc:uniqueidentifier,xbmc:country"
94 +#define PLT_DEFAULT_FILTER "dc:date,dc:description,upnp:longDescription,upnp:genre,res,res@duration,res@size,upnp:albumArtURI,upnp:rating,upnp:lastPlaybackPosition,upnp:lastPlaybackTime,upnp:playbackCount,upnp:originalTrackNumber,upnp:episodeNumber,upnp:programTitle,upnp:seriesTitle,upnp:album,upnp:artist,upnp:author,upnp:director,dc:publisher,searchable,childCount,dc:title,dc:creator,upnp:actor,res@resolution,upnp:episodeCount,upnp:episodeSeason,xbmc:dateadded,xbmc:rating,xbmc:votes,xbmc:artwork,xbmc:uniqueidentifier,xbmc:country,xbmc:userrating"
96 /*----------------------------------------------------------------------
97 | PLT_MediaContainerListener
98 --
99 1.9.5.msysgit.0