mirror of
https://github.com/owntone/owntone-server.git
synced 2025-01-16 09:13:18 -05:00
Get rid of magic hash values for filtering query parameters
Some metadata were filtered out from the reply by directly checking for their hash, including the hash value in the code. Remove the magic values and compare dfm->field against the relevant dmap_* field as for other special cases.
This commit is contained in:
parent
2524eb0f8f
commit
3280fd5cf9
@ -1728,12 +1728,19 @@ daap_reply_playlists(struct evhttp_request *req, struct evbuffer *evbuf, char **
|
|||||||
|
|
||||||
for (i = 0; i < nmeta; i++)
|
for (i = 0; i < nmeta; i++)
|
||||||
{
|
{
|
||||||
|
dfm = dmap_find_field(meta[i]);
|
||||||
|
if (!dfm)
|
||||||
|
{
|
||||||
|
DPRINTF(E_LOG, L_DAAP, "Could not find requested meta field (%d)\n", i + 1);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
/* dmap.itemcount - always added */
|
/* dmap.itemcount - always added */
|
||||||
if (meta[i] == 0xd4b8b70d)
|
if (dfm->field == &dmap_mimc)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* com.apple.itunes.smart-playlist - type = 1 AND id != 1 */
|
/* com.apple.itunes.smart-playlist - type = 1 AND id != 1 */
|
||||||
if (meta[i] == 0x670fc55e)
|
if (dfm->field == &dmap_aeSP)
|
||||||
{
|
{
|
||||||
val = 0;
|
val = 0;
|
||||||
ret = safe_atoi32(dbpli.type, &val);
|
ret = safe_atoi32(dbpli.type, &val);
|
||||||
@ -1755,13 +1762,6 @@ daap_reply_playlists(struct evhttp_request *req, struct evbuffer *evbuf, char **
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
dfm = dmap_find_field(meta[i]);
|
|
||||||
if (!dfm)
|
|
||||||
{
|
|
||||||
DPRINTF(E_LOG, L_DAAP, "Could not find requested meta field (%d)\n", i + 1);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Not in struct playlist_info */
|
/* Not in struct playlist_info */
|
||||||
if (dfm->pli_offset < 0)
|
if (dfm->pli_offset < 0)
|
||||||
continue;
|
continue;
|
||||||
@ -1972,10 +1972,6 @@ daap_reply_groups(struct evhttp_request *req, struct evbuffer *evbuf, char **uri
|
|||||||
|
|
||||||
for (i = 0; i < nmeta; i++)
|
for (i = 0; i < nmeta; i++)
|
||||||
{
|
{
|
||||||
/* dmap.itemcount - always added */
|
|
||||||
if (meta[i] == 0xd4b8b70d)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
dfm = dmap_find_field(meta[i]);
|
dfm = dmap_find_field(meta[i]);
|
||||||
if (!dfm)
|
if (!dfm)
|
||||||
{
|
{
|
||||||
@ -1983,6 +1979,10 @@ daap_reply_groups(struct evhttp_request *req, struct evbuffer *evbuf, char **uri
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* dmap.itemcount - always added */
|
||||||
|
if (dfm->field == &dmap_mimc)
|
||||||
|
continue;
|
||||||
|
|
||||||
/* Not in struct group_info */
|
/* Not in struct group_info */
|
||||||
if (dfm->gri_offset < 0)
|
if (dfm->gri_offset < 0)
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user