[db] fixup

This commit is contained in:
chme 2016-12-04 11:34:19 +01:00
parent edc609b531
commit d339f5bcd2

View File

@ -4553,14 +4553,14 @@ db_queue_add_by_fileid(int id, char reshuffle, uint32_t item_id)
static int
queue_enum_start(struct query_params *query_params)
{
#define Q_TMPL "SELECT * FROM queue WHERE %s ORDER BY %s;"
#define Q_TMPL "SELECT * FROM queue WHERE %s %s;"
char *query;
const char *orderby;
int ret;
query_params->stmt = NULL;
if (query_params)
if (query_params->sort)
orderby = sort_clause[query_params->sort];
else
orderby = sort_clause[S_POS];