From a96af67a30e687cc8f73d3045f6bceffffb2d003 Mon Sep 17 00:00:00 2001 From: ejurgensen Date: Sat, 10 Jan 2015 00:45:19 +0100 Subject: [PATCH] Some fixing up of prev commit --- src/db.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/db.c b/src/db.c index 22537b4f..225cc004 100644 --- a/src/db.c +++ b/src/db.c @@ -1445,16 +1445,16 @@ db_build_query_browse(struct query_params *qp, char *field, char *sort_field, ch if (idx && qp->filter) query = sqlite3_mprintf("SELECT f.%s, f.%s FROM files f WHERE f.disabled = 0 AND f.%s != ''" - " AND %s GROUP BY f.%s %s %s;", field, sort_field, field, qp->filter, field, sort, idx); + " AND %s GROUP BY f.%s %s %s;", field, sort_field, field, qp->filter, sort_field, sort, idx); else if (idx) query = sqlite3_mprintf("SELECT f.%s, f.%s FROM files f WHERE f.disabled = 0 AND f.%s != ''" - " GROUP BY f.%s %s %s;", field, sort_field, field, field, sort, idx); + " GROUP BY f.%s %s %s;", field, sort_field, field, sort_field, sort, idx); else if (qp->filter) query = sqlite3_mprintf("SELECT f.%s, f.%s FROM files f WHERE f.disabled = 0 AND f.%s != ''" - " AND %s GROUP BY f.%s %s;", field, sort_field, field, qp->filter, field, sort); + " AND %s GROUP BY f.%s %s;", field, sort_field, field, qp->filter, sort_field, sort); else query = sqlite3_mprintf("SELECT f.%s, f.%s FROM files f WHERE f.disabled = 0 AND f.%s != ''" - " GROUP BY f.%s %s", field, sort_field, field, field, sort); + " GROUP BY f.%s %s", field, sort_field, field, sort_field, sort); free(sort); @@ -4475,6 +4475,7 @@ static const struct db_init_query db_init_index_queries[] = { I_ARTIST, "create artist index" }, { I_ALBUMARTIST, "create album_artist index" }, { I_COMPOSER, "create composer index" }, + { I_GENRE, "create genre index" }, { I_TITLE, "create title index" }, { I_ALBUM, "create album index" },