Merge pull request #25959 from neo1973/TagLib_deprecation_warnings
[xbmc.git] / lib / libUPnP / patches / 0036-platinum-add-xbmc-country-for-countries.patch
blob2f1a4b72aec5398d4d35f68d908d5964b7432122
1 From 2f0e4019673a92b3c1e01fd2447bd05e7b231423 Mon Sep 17 00:00:00 2001
2 From: montellese <montellese@xbmc.org>
3 Date: Sun, 8 Mar 2015 23:49:24 +0100
4 Subject: [PATCH 1/3] platinum: add xbmc:country for countries
6 ---
7 lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.cpp | 2 ++
8 lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.h | 2 ++
9 .../Platinum/Source/Devices/MediaServer/PltMediaItem.cpp | 11 +++++++++++
10 .../Platinum/Source/Devices/MediaServer/PltMediaItem.h | 1 +
11 .../Platinum/Source/Devices/MediaServer/PltSyncMediaBrowser.h | 2 +-
12 5 files changed, 17 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 b58aa50..0f24ab3 100644
16 --- a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.cpp
17 +++ b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.cpp
18 @@ -173,6 +173,8 @@ PLT_Didl::ConvertFilterToMask(const NPT_String& filter)
19 mask |= PLT_FILTER_MASK_XBMC_ARTWORK;
20 } else if (NPT_String::CompareN(s+i, PLT_FILTER_FIELD_XBMC_UNIQUE_IDENTIFIER, len, true) == 0) {
21 mask |= PLT_FILTER_MASK_XBMC_UNIQUE_IDENTIFIER;
22 + } else if (NPT_String::CompareN(s + i, PLT_FILTER_FIELD_XBMC_COUNTRY, len, true) == 0) {
23 + mask |= PLT_FILTER_MASK_XBMC_COUNTRY;
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 fe1de45..49b92d0 100644
29 --- a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.h
30 +++ b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.h
31 @@ -100,6 +100,7 @@
32 #define PLT_FILTER_MASK_XBMC_VOTES NPT_UINT64_C(0x0000400000000000)
33 #define PLT_FILTER_MASK_XBMC_ARTWORK NPT_UINT64_C(0x0000800000000000)
34 #define PLT_FILTER_MASK_XBMC_UNIQUE_IDENTIFIER NPT_UINT64_C(0x0001000000000000)
35 +#define PLT_FILTER_MASK_XBMC_COUNTRY NPT_UINT64_C(0x0002000000000000)
37 #define PLT_FILTER_FIELD_TITLE "dc:title"
38 #define PLT_FILTER_FIELD_CREATOR "dc:creator"
39 @@ -150,6 +151,7 @@
40 #define PLT_FILTER_FIELD_XBMC_VOTES "xbmc:votes"
41 #define PLT_FILTER_FIELD_XBMC_ARTWORK "xbmc:artwork"
42 #define PLT_FILTER_FIELD_XBMC_UNIQUE_IDENTIFIER "xbmc:uniqueidentifier"
43 +#define PLT_FILTER_FIELD_XBMC_COUNTRY "xbmc:country"
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 f937df2..2e7d32b 100644
49 --- a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp
50 +++ b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp
51 @@ -261,6 +261,7 @@ PLT_MediaObject::Reset()
52 m_XbmcInfo.votes = "";
53 m_XbmcInfo.artwork.Clear();
54 m_XbmcInfo.unique_identifier = "";
55 + m_XbmcInfo.countries.Clear();
57 m_Didl = "";
59 @@ -606,6 +607,16 @@ PLT_MediaObject::ToDidl(NPT_UInt64 mask, NPT_String& didl)
60 didl += "</xbmc:uniqueidentifier>";
63 + // country
64 + if (mask & PLT_FILTER_MASK_XBMC_COUNTRY) {
65 + for (NPT_List<NPT_String>::Iterator it =
66 + m_XbmcInfo.countries.GetFirstItem(); it; ++it) {
67 + didl += "<xbmc:country>";
68 + PLT_Didl::AppendXmlEscape(didl, (*it));
69 + didl += "</xbmc:country>";
70 + }
71 + }
73 // class is required
74 didl += "<upnp:class";
75 if (!m_ObjectClass.friendly_name.IsEmpty()) {
76 diff --git a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.h b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.h
77 index 6461b81..0efd505 100644
78 --- a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.h
79 +++ b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.h
80 @@ -170,6 +170,7 @@ typedef struct {
81 NPT_String votes;
82 PLT_Artworks artwork;
83 NPT_String unique_identifier;
84 + NPT_List<NPT_String> countries;
85 } PLT_XbmcInfo;
87 typedef struct {
88 diff --git a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltSyncMediaBrowser.h b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltSyncMediaBrowser.h
89 index 8fb23dd..9b25d58 100644
90 --- a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltSyncMediaBrowser.h
91 +++ b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltSyncMediaBrowser.h
92 @@ -70,7 +70,7 @@ typedef struct PLT_CapabilitiesData {
93 typedef NPT_Reference<PLT_CapabilitiesData> PLT_CapabilitiesDataReference;
95 // explicitely specify res otherwise WMP won't return a URL!
96 -#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"
97 +#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"
99 /*----------------------------------------------------------------------
100 | PLT_MediaContainerListener
102 1.9.5.msysgit.0