From 3832692929b694c47013672081bd59ac59499467 Mon Sep 17 00:00:00 2001 From: chme Date: Fri, 1 May 2015 10:47:48 +0200 Subject: [PATCH] move setting query_params.sort out of generic queue make function --- src/player.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/player.c b/src/player.c index 88ee6eec..1842222b 100644 --- a/src/player.c +++ b/src/player.c @@ -760,7 +760,7 @@ metadata_check_icy(void) /* Audio sources */ /* Thread: httpd (DACP) */ static struct player_source * -player_queue_make(struct query_params *qp, const char *sort) +player_queue_make(struct query_params *qp) { struct db_media_file_info dbmfi; struct player_source *q_head; @@ -770,16 +770,6 @@ player_queue_make(struct query_params *qp, const char *sort) uint32_t song_length; int ret; - if (sort) - { - if (strcmp(sort, "name") == 0) - qp->sort = S_NAME; - else if (strcmp(sort, "album") == 0) - qp->sort = S_ALBUM; - else if (strcmp(sort, "artist") == 0) - qp->sort = S_ARTIST; - } - ret = db_query_start(qp); if (ret < 0) { @@ -1039,7 +1029,17 @@ player_queue_make_daap(struct player_source **head, const char *query, const cha qp.filter = daap_query_parse_sql(query); } - ps = player_queue_make(&qp, sort); + if (sort) + { + if (strcmp(sort, "name") == 0) + qp.sort = S_NAME; + else if (strcmp(sort, "album") == 0) + qp.sort = S_ALBUM; + else if (strcmp(sort, "artist") == 0) + qp.sort = S_ARTIST; + } + + ps = player_queue_make(&qp); if (qp.filter) free(qp.filter); @@ -1093,7 +1093,7 @@ player_queue_make_pl(int plid, uint32_t *id) qp.idx_type = I_NONE; - ps = player_queue_make(&qp, NULL); + ps = player_queue_make(&qp); if (qp.filter) free(qp.filter); @@ -1145,7 +1145,7 @@ player_queue_make_mpd(char *path, int recursive) DPRINTF(E_DBG, L_PLAYER, "Out of memory\n"); } - ps = player_queue_make(&qp, NULL); + ps = player_queue_make(&qp); sqlite3_free(qp.filter); return ps;