diff --git a/src/httpd_daap.c b/src/httpd_daap.c index 0fc6e053..6545bf23 100644 --- a/src/httpd_daap.c +++ b/src/httpd_daap.c @@ -1728,12 +1728,19 @@ daap_reply_playlists(struct evhttp_request *req, struct evbuffer *evbuf, char ** 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 */ - if (meta[i] == 0xd4b8b70d) + if (dfm->field == &dmap_mimc) continue; /* com.apple.itunes.smart-playlist - type = 1 AND id != 1 */ - if (meta[i] == 0x670fc55e) + if (dfm->field == &dmap_aeSP) { val = 0; ret = safe_atoi32(dbpli.type, &val); @@ -1755,13 +1762,6 @@ daap_reply_playlists(struct evhttp_request *req, struct evbuffer *evbuf, char ** 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 */ if (dfm->pli_offset < 0) continue; @@ -1972,10 +1972,6 @@ daap_reply_groups(struct evhttp_request *req, struct evbuffer *evbuf, char **uri for (i = 0; i < nmeta; i++) { - /* dmap.itemcount - always added */ - if (meta[i] == 0xd4b8b70d) - continue; - dfm = dmap_find_field(meta[i]); if (!dfm) { @@ -1983,6 +1979,10 @@ daap_reply_groups(struct evhttp_request *req, struct evbuffer *evbuf, char **uri continue; } + /* dmap.itemcount - always added */ + if (dfm->field == &dmap_mimc) + continue; + /* Not in struct group_info */ if (dfm->gri_offset < 0) continue;