Merge pull request #26220 from 78andyp/blurayfixes
[xbmc.git] / lib / libUPnP / patches / 0034-platinum-add-xbmc-uniqueidentifier-for-IMDB-TVDB-ide.patch
blob314592450547b9a08e492145c09637546f9a897b
1 From 03a57931ab47724558d3ed8762a2c978cf056501 Mon Sep 17 00:00:00 2001
2 From: montellese <montellese@xbmc.org>
3 Date: Sat, 29 Nov 2014 19:58:33 +0100
4 Subject: [PATCH] platinum: add xbmc:uniqueidentifier for IMDB/TVDB identifiers
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 | 10 ++++++++++
10 lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.h | 1 +
11 .../Platinum/Source/Devices/MediaServer/PltSyncMediaBrowser.h | 2 +-
12 5 files changed, 16 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 2bb6a04..7b853c8 100644
16 --- a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.cpp
17 +++ b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.cpp
18 @@ -170,6 +170,8 @@ PLT_Didl::ConvertFilterToMask(const NPT_String& filter)
19 mask |= PLT_FILTER_MASK_XBMC_VOTES;
20 } else if (NPT_String::CompareN(s+i, PLT_FILTER_FIELD_XBMC_ARTWORK, len, true) == 0) {
21 mask |= PLT_FILTER_MASK_XBMC_ARTWORK;
22 + } else if (NPT_String::CompareN(s+i, PLT_FILTER_FIELD_XBMC_UNIQUE_IDENTIFIER, len, true) == 0) {
23 + mask |= PLT_FILTER_MASK_XBMC_UNIQUE_IDENTIFIER;
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 0f7c892..a5015db 100644
29 --- a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.h
30 +++ b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.h
31 @@ -99,6 +99,7 @@
32 #define PLT_FILTER_MASK_XBMC_RATING NPT_UINT64_C(0x0000200000000000)
33 #define PLT_FILTER_MASK_XBMC_VOTES NPT_UINT64_C(0x0000400000000000)
34 #define PLT_FILTER_MASK_XBMC_ARTWORK NPT_UINT64_C(0x0000800000000000)
35 +#define PLT_FILTER_MASK_XBMC_UNIQUE_IDENTIFIER NPT_UINT64_C(0x0001000000000000)
37 #define PLT_FILTER_FIELD_TITLE "dc:title"
38 #define PLT_FILTER_FIELD_CREATOR "dc:creator"
39 @@ -148,6 +149,7 @@
40 #define PLT_FILTER_FIELD_XBMC_RATING "xbmc:rating"
41 #define PLT_FILTER_FIELD_XBMC_VOTES "xbmc:votes"
42 #define PLT_FILTER_FIELD_XBMC_ARTWORK "xbmc:artwork"
43 +#define PLT_FILTER_FIELD_XBMC_UNIQUE_IDENTIFIER "xbmc:uniqueidentifier"
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 0c6830f..f8ddd85 100644
49 --- a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp
50 +++ b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp
51 @@ -260,6 +260,7 @@ PLT_MediaObject::Reset()
52 m_XbmcInfo.rating = 0.0f;
53 m_XbmcInfo.votes = "";
54 m_XbmcInfo.artwork.Clear();
55 + m_XbmcInfo.unique_identifier = "";
57 m_Didl = "";
59 @@ -559,6 +560,13 @@ PLT_MediaObject::ToDidl(NPT_UInt64 mask, NPT_String& didl)
60 m_XbmcInfo.artwork.ToDidl(didl, "artwork");
63 + // xbmc unique identifier
64 + if (mask & PLT_FILTER_MASK_XBMC_UNIQUE_IDENTIFIER && !m_XbmcInfo.unique_identifier.IsEmpty()) {
65 + didl += "<xbmc:uniqueidentifier>";
66 + PLT_Didl::AppendXmlEscape(didl, m_XbmcInfo.unique_identifier);
67 + didl += "</xbmc:uniqueidentifier>";
68 + }
70 // class is required
71 didl += "<upnp:class";
72 if (!m_ObjectClass.friendly_name.IsEmpty()) {
73 @@ -781,6 +789,8 @@ PLT_MediaObject::FromDidl(NPT_XmlElementNode* entry)
74 PLT_XmlHelper::GetChildren(entry, children, "artwork", didl_namespace_xbmc);
75 m_XbmcInfo.artwork.FromDidl(children);
77 + PLT_XmlHelper::GetChildText(entry, "uniqueidentifier", m_XbmcInfo.unique_identifier, didl_namespace_xbmc, 256);
79 // re serialize the entry didl as a we might need to pass it to a renderer
80 // we may have modified the tree to "fix" issues, so as not to break a renderer
81 // (don't write xml prefix as this didl could be part of a larger document)
82 diff --git a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.h b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.h
83 index 18a094f..dd7f8ae 100644
84 --- a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.h
85 +++ b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.h
86 @@ -169,6 +169,7 @@ typedef struct {
87 NPT_Float rating;
88 NPT_String votes;
89 PLT_Artworks artwork;
90 + NPT_String unique_identifier;
91 } PLT_XbmcInfo;
93 /*----------------------------------------------------------------------
94 diff --git a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltSyncMediaBrowser.h b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltSyncMediaBrowser.h
95 index 21f1d28..8fb23dd 100644
96 --- a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltSyncMediaBrowser.h
97 +++ b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltSyncMediaBrowser.h
98 @@ -70,7 +70,7 @@ typedef struct PLT_CapabilitiesData {
99 typedef NPT_Reference<PLT_CapabilitiesData> PLT_CapabilitiesDataReference;
101 // explicitely specify res otherwise WMP won't return a URL!
102 -#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"
103 +#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"
105 /*----------------------------------------------------------------------
106 | PLT_MediaContainerListener
108 1.9.4.msysgit.2