Add handler for DMAP extra_data requests

iPhone Remote uses the following requests to get cover art for
songs and albums:

/databases/#/items/#/extra_data/artwork
/databases/#/groups/#/extra_data/artwork

For now, we will return the valid and correct response that we
have "No content".  In the future, the real artwork could be
extracted and returned here.
This commit is contained in:
Ace Jones 2010-01-03 18:11:16 +01:00 committed by Julien BLACHE
parent d20fdbda95
commit 117ee15e44
1 changed files with 15 additions and 0 deletions

View File

@ -1666,6 +1666,13 @@ daap_reply_browse(struct evhttp_request *req, struct evbuffer *evbuf, char **uri
evhttp_send_reply(req, HTTP_OK, "OK", evbuf);
}
static void
daap_reply_extra_data(struct evhttp_request *req, struct evbuffer *evbuf, char **uri, struct evkeyvalq *query)
{
/* Sorry, we have no artwork */
evhttp_send_reply(req, HTTP_NOCONTENT, "No Content", evbuf);
}
static void
daap_stream(struct evhttp_request *req, struct evbuffer *evbuf, char **uri, struct evkeyvalq *query)
{
@ -1752,6 +1759,10 @@ static struct uri_map daap_handlers[] =
.regexp = "^/databases/[[:digit:]]+/items/[[:digit:]]+[.][^/]+$",
.handler = daap_stream
},
{
.regexp = "^/databases/[[:digit:]]+/items/[[:digit:]]+/extra_data/artwork$",
.handler = daap_reply_extra_data
},
{
.regexp = "^/databases/[[:digit:]]+/containers$",
.handler = daap_reply_playlists
@ -1760,6 +1771,10 @@ static struct uri_map daap_handlers[] =
.regexp = "^/databases/[[:digit:]]+/containers/[[:digit:]]+/items$",
.handler = daap_reply_plsonglist
},
{
.regexp = "^/databases/[[:digit:]]+/groups/[[:digit:]]+/extra_data/artwork$",
.handler = daap_reply_extra_data
},
{
.regexp = NULL,
.handler = NULL