From 6a9579be3afecaae2f62baacca10335de1371cf1 Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Fri, 7 Aug 2009 13:20:45 +0200 Subject: New feature: Seed suggestions --- libpiano/src/xml.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'libpiano/src/xml.c') diff --git a/libpiano/src/xml.c b/libpiano/src/xml.c index 2cc519f..b02df5d 100644 --- a/libpiano/src/xml.c +++ b/libpiano/src/xml.c @@ -647,6 +647,28 @@ PianoReturn_t PianoXmlParseSearch (char *xml, return PIANO_RET_OK; } +/* FIXME: copy&waste (PianoXmlParseSearch) + */ +PianoReturn_t PianoXmlParseSeedSuggestions (char *xml, + PianoSearchResult_t *searchResult) { + ezxml_t xmlDoc, dataNode; + PianoReturn_t ret; + + if ((ret = PianoXmlInitDoc (xml, &xmlDoc)) != PIANO_RET_OK) { + return ret; + } + + dataNode = ezxml_get (xmlDoc, "params", 0, "param", 0, "value", -1); + /* we need a "clean" search result (with null pointers) */ + memset (searchResult, 0, sizeof (*searchResult)); + /* reuse seach result parser; structure is nearly the same */ + PianoXmlParseSearchCb ("artists", dataNode, searchResult); + + ezxml_free (xmlDoc); + + return PIANO_RET_OK; +} + /* encode reserved xml chars * TODO: remove and use ezxml_ampencode * @param encode this -- cgit v1.2.3