mirror of
https://github.com/owntone/owntone-server.git
synced 2025-12-05 23:33:13 -05:00
Add support for artist group request (experimental)
The purpose of this is mainly to support Hyperfine Remote for Android
This commit is contained in:
@@ -1515,6 +1515,7 @@ daap_reply_groups(struct evhttp_request *req, struct evbuffer *evbuf, char **uri
|
||||
struct sort_ctx *sctx;
|
||||
const char *param;
|
||||
char **strval;
|
||||
int group_type;
|
||||
int nmeta;
|
||||
int sort_headers;
|
||||
int ngrp;
|
||||
@@ -1527,8 +1528,17 @@ daap_reply_groups(struct evhttp_request *req, struct evbuffer *evbuf, char **uri
|
||||
if (!s)
|
||||
return;
|
||||
|
||||
/* For now we only support album groups */
|
||||
tag = "agal";
|
||||
param = evhttp_find_header(query, "group-type");
|
||||
if (strcmp(param, "artists") == 0)
|
||||
{
|
||||
tag = "agar";
|
||||
group_type = Q_GROUP_ARTISTS;
|
||||
}
|
||||
else
|
||||
{
|
||||
tag = "agal";
|
||||
group_type = Q_GROUP_ALBUMS;
|
||||
}
|
||||
|
||||
ret = evbuffer_expand(evbuf, 61);
|
||||
if (ret < 0)
|
||||
@@ -1595,7 +1605,7 @@ daap_reply_groups(struct evhttp_request *req, struct evbuffer *evbuf, char **uri
|
||||
|
||||
memset(&qp, 0, sizeof(struct query_params));
|
||||
get_query_params(query, &sort_headers, &qp);
|
||||
qp.type = Q_GROUPS;
|
||||
qp.type = group_type;
|
||||
|
||||
sctx = NULL;
|
||||
if (sort_headers)
|
||||
@@ -1669,8 +1679,9 @@ daap_reply_groups(struct evhttp_request *req, struct evbuffer *evbuf, char **uri
|
||||
if ((ret == 0) && (val > 0))
|
||||
dmap_add_int(group, "mimc", val);
|
||||
|
||||
/* Song album artist, always added (asaa) */
|
||||
dmap_add_string(group, "asaa", dbgri.songalbumartist);
|
||||
/* Song album artist (asaa), always added if group-type is albums */
|
||||
if (group_type == Q_GROUP_ALBUMS)
|
||||
dmap_add_string(group, "asaa", dbgri.songalbumartist);
|
||||
|
||||
/* Item id (miid) */
|
||||
val = 0;
|
||||
|
||||
Reference in New Issue
Block a user