diff options
author | Alasdair Campbell <alcoheca@gmail.com> | 2012-10-26 12:57:58 +0100 |
---|---|---|
committer | montellese <montellese@xbmc.org> | 2014-05-17 09:53:12 +0200 |
commit | c6d2a53c63a065a974c3f8fd1df29c30c2e2b40a (patch) | |
tree | cc6629596163006fb609539d8deacca08223bee7 /lib/libUPnP/Platinum | |
parent | 7f93296d158095f59169d12c4181af060f4b9884 (diff) |
platinum: fix missing filtering for extra metadata
Diffstat (limited to 'lib/libUPnP/Platinum')
3 files changed, 16 insertions, 3 deletions
diff --git a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.cpp b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.cpp index 6f72ddaf26..73f9ed21cd 100644 --- a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.cpp +++ b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.cpp @@ -111,6 +111,12 @@ PLT_Didl::ConvertFilterToMask(const NPT_String& filter) mask |= PLT_FILTER_MASK_LONGDESCRIPTION; } else if (NPT_String::CompareN(s+i, PLT_FILTER_FIELD_ORIGINALTRACK, len, true) == 0) { mask |= PLT_FILTER_MASK_ORIGINALTRACK; + } else if (NPT_String::CompareN(s+i, PLT_FILTER_FIELD_LASTPOSITION, len, true) == 0) { + mask |= PLT_FILTER_MASK_LASTPOSITION; + } else if (NPT_String::CompareN(s+i, PLT_FILTER_FIELD_LASTPLAYBACK, len, true) == 0) { + mask |= PLT_FILTER_MASK_LASTPLAYBACK; + } else if (NPT_String::CompareN(s+i, PLT_FILTER_FIELD_PLAYCOUNT, len, true) == 0) { + mask |= PLT_FILTER_MASK_PLAYCOUNT; } else if (NPT_String::CompareN(s+i, PLT_FILTER_FIELD_SEARCHABLE, len, true) == 0) { mask |= PLT_FILTER_MASK_SEARCHABLE; } else if (NPT_String::CompareN(s+i, PLT_FILTER_FIELD_SEARCHCLASS, len, true) == 0) { diff --git a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.h b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.h index 29ce9ca15c..9af9725789 100644 --- a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.h +++ b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltDidl.h @@ -86,6 +86,10 @@ #define PLT_FILTER_MASK_SEARCHCLASS 0x0000000040000000 #define PLT_FILTER_MASK_REFID 0x0000000080000000 +#define PLT_FILTER_MASK_LASTPOSITION 0x0000000100000000 +#define PLT_FILTER_MASK_LASTPLAYBACK 0x0000000200000000 +#define PLT_FILTER_MASK_PLAYCOUNT 0x0000000400000000 + #define PLT_FILTER_FIELD_TITLE "dc:title" #define PLT_FILTER_FIELD_CREATOR "dc:creator" #define PLT_FILTER_FIELD_DATE "dc:date" @@ -105,6 +109,9 @@ #define PLT_FILTER_FIELD_PROGRAMTITLE "upnp:programTitle" #define PLT_FILTER_FIELD_SERIESTITLE "upnp:seriesTitle" #define PLT_FILTER_FIELD_EPISODE "upnp:episodeNumber" +#define PLT_FILTER_FIELD_LASTPOSITION "upnp:lastPlaybackPosition" +#define PLT_FILTER_FIELD_LASTPLAYBACK "upnp:lastPlaybackTime" +#define PLT_FILTER_FIELD_PLAYCOUNT "upnp:playbackCount" #define PLT_FILTER_FIELD_SEARCHCLASS "upnp:searchClass" #define PLT_FILTER_FIELD_SEARCHABLE "@searchable" #define PLT_FILTER_FIELD_CHILDCOUNT "@childcount" diff --git a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp index 31bc16c6e5..af6bc3b5df 100644 --- a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp +++ b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp @@ -333,21 +333,21 @@ PLT_MediaObject::ToDidl(NPT_UInt64 mask, NPT_String& didl) } // last playback position - if (m_MiscInfo.last_position > 0) { + if (mask & PLT_FILTER_MASK_LASTPOSITION && m_MiscInfo.last_position > 0) { didl += "<upnp:lastPlaybackPosition>"; didl += NPT_String::FromInteger(m_MiscInfo.last_position); didl += "</upnp:lastPlaybackPosition>"; } // last playback datetime - if (!m_MiscInfo.last_time.IsEmpty()) { + if (mask & PLT_FILTER_MASK_LASTPLAYBACK && !m_MiscInfo.last_time.IsEmpty()) { didl += "<upnp:lastPlaybackTime>"; PLT_Didl::AppendXmlEscape(didl, m_MiscInfo.last_time); didl += "</upnp:lastPlaybackTime>"; } // playcount - if (m_MiscInfo.play_count > -1) { + if (mask & PLT_FILTER_MASK_PLAYCOUNT && m_MiscInfo.play_count > -1) { didl += "<upnp:playbackCount>"; didl += NPT_String::FromInteger(m_MiscInfo.play_count); didl += "</upnp:playbackCount>"; |