diff options
author | Alasdair Campbell <alcoheca@gmail.com> | 2012-10-26 12:57:58 +0100 |
---|---|---|
committer | Alasdair Campbell <alcoheca@gmail.com> | 2012-10-26 13:01:36 +0100 |
commit | d8136383aa2a421abb506112ce7e9dc33d7322a0 (patch) | |
tree | 6475eeb91016c051391080afab30beee09cddacb /lib | |
parent | 199309d0bf8cf6ad84fc433aa95d0e5763bd1e57 (diff) |
Platinum: fix missing filtering for extra metadata
Diffstat (limited to 'lib')
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 a3561fde75..38560015dc 100644 --- a/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp +++ b/lib/libUPnP/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp @@ -334,21 +334,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>"; |