[http_daapd] Add option to hide albums/artists with just one track

This commit is contained in:
ejurgensen
2015-12-12 23:28:48 +01:00
parent cb9034bee7
commit 6e58af75cf
3 changed files with 13 additions and 0 deletions

View File

@@ -69,6 +69,7 @@ static cfg_opt_t sec_library[] =
CFG_STR_LIST("audiobooks", NULL, CFGF_NONE),
CFG_STR_LIST("compilations", NULL, CFGF_NONE),
CFG_STR("compilation_artist", NULL, CFGF_NONE),
CFG_BOOL("hide_singles", cfg_false, CFGF_NONE),
CFG_BOOL("radio_playlists", cfg_false, CFGF_NONE),
CFG_STR("name_library", "Library", CFGF_NONE),
CFG_STR("name_music", "Music", CFGF_NONE),

View File

@@ -1848,6 +1848,7 @@ daap_reply_groups(struct evhttp_request *req, struct evbuffer *evbuf, char **uri
const struct dmap_field *df;
const struct dmap_field **meta;
struct sort_ctx *sctx;
cfg_t *lib;
const char *param;
char **strval;
char *tag;
@@ -1979,6 +1980,11 @@ daap_reply_groups(struct evhttp_request *req, struct evbuffer *evbuf, char **uri
if (strlen(dbgri.itemname) == 0)
continue;
/* Don't add single item albums/artists if configured to hide */
lib = cfg_getsec(cfg, "library");
if (cfg_getbool(lib, "hide_singles") && (strcmp(dbgri.itemcount, "1") == 0))
continue;
ngrp++;
for (i = 0; i < nmeta; i++)