From bd19c357ebe5428cbfff4bbc58e7939fb73f1e1f Mon Sep 17 00:00:00 2001 From: montellese Date: Sat, 29 Nov 2014 19:58:33 +0100 Subject: platinum: add xbmc:uniqueidentifier for IMDB/TVDB identifiers --- lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.cpp | 2 ++ lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.h | 2 ++ .../Platinum/Source/Devices/MediaServer/PltMediaItem.cpp | 10 ++++++++++ lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.h | 1 + .../Platinum/Source/Devices/MediaServer/PltSyncMediaBrowser.h | 2 +- 5 files changed, 16 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.cpp b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.cpp index 2bb6a04139..7b853c8c9a 100644 --- a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.cpp +++ b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.cpp @@ -170,6 +170,8 @@ PLT_Didl::ConvertFilterToMask(const NPT_String& filter) mask |= PLT_FILTER_MASK_XBMC_VOTES; } else if (NPT_String::CompareN(s+i, PLT_FILTER_FIELD_XBMC_ARTWORK, len, true) == 0) { mask |= PLT_FILTER_MASK_XBMC_ARTWORK; + } else if (NPT_String::CompareN(s+i, PLT_FILTER_FIELD_XBMC_UNIQUE_IDENTIFIER, len, true) == 0) { + mask |= PLT_FILTER_MASK_XBMC_UNIQUE_IDENTIFIER; } if (next_comma < 0) { diff --git a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.h b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.h index 9e87599955..fe1de45cde 100644 --- a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.h +++ b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.h @@ -99,6 +99,7 @@ #define PLT_FILTER_MASK_XBMC_RATING NPT_UINT64_C(0x0000200000000000) #define PLT_FILTER_MASK_XBMC_VOTES NPT_UINT64_C(0x0000400000000000) #define PLT_FILTER_MASK_XBMC_ARTWORK NPT_UINT64_C(0x0000800000000000) +#define PLT_FILTER_MASK_XBMC_UNIQUE_IDENTIFIER NPT_UINT64_C(0x0001000000000000) #define PLT_FILTER_FIELD_TITLE "dc:title" #define PLT_FILTER_FIELD_CREATOR "dc:creator" @@ -148,6 +149,7 @@ #define PLT_FILTER_FIELD_XBMC_RATING "xbmc:rating" #define PLT_FILTER_FIELD_XBMC_VOTES "xbmc:votes" #define PLT_FILTER_FIELD_XBMC_ARTWORK "xbmc:artwork" +#define PLT_FILTER_FIELD_XBMC_UNIQUE_IDENTIFIER "xbmc:uniqueidentifier" extern const char* didl_header; extern const char* didl_footer; diff --git a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp index 5c2ec8494a..4db2d45ebd 100644 --- a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp +++ b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp @@ -260,6 +260,7 @@ PLT_MediaObject::Reset() m_XbmcInfo.rating = 0.0f; m_XbmcInfo.votes = ""; m_XbmcInfo.artwork.Clear(); + m_XbmcInfo.unique_identifier = ""; m_Didl = ""; @@ -559,6 +560,13 @@ PLT_MediaObject::ToDidl(NPT_UInt64 mask, NPT_String& didl) m_XbmcInfo.artwork.ToDidl(didl, "artwork"); } + // xbmc unique identifier + if (mask & PLT_FILTER_MASK_XBMC_UNIQUE_IDENTIFIER && !m_XbmcInfo.unique_identifier.IsEmpty()) { + didl += ""; + PLT_Didl::AppendXmlEscape(didl, m_XbmcInfo.unique_identifier); + didl += ""; + } + // class is required didl += " PLT_CapabilitiesDataReference; // explicitely specify res otherwise WMP won't return a URL! -#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" +#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" /*---------------------------------------------------------------------- | PLT_MediaContainerListener -- cgit v1.2.3