diff --git a/src/db.c b/src/db.c index 95874122..34e6c6e7 100644 --- a/src/db.c +++ b/src/db.c @@ -247,6 +247,7 @@ static const char *sort_clause[] = "", "ORDER BY title COLLATE DAAP ASC", "ORDER BY album COLLATE DAAP ASC, disc ASC, track ASC", + "ORDER BY artist COLLATE DAAP ASC", }; static char *db_path; diff --git a/src/db.h b/src/db.h index 756120f9..309049b6 100644 --- a/src/db.h +++ b/src/db.h @@ -20,6 +20,7 @@ enum sort_type { S_NONE = 0, S_NAME, S_ALBUM, + S_ARTIST, }; #define Q_F_BROWSE (1 << 15) diff --git a/src/httpd_daap.c b/src/httpd_daap.c index f1c1ec78..52f28dac 100644 --- a/src/httpd_daap.c +++ b/src/httpd_daap.c @@ -1058,6 +1058,8 @@ get_query_params(struct evkeyvalq *query, int *sort_headers, struct query_params qp->sort = S_NAME; else if (strcmp(param, "album") == 0) qp->sort = S_ALBUM; + else if (strcmp(param, "artist") == 0) + qp->sort = S_ARTIST; else DPRINTF(E_DBG, L_DAAP, "Unknown sort param: %s\n", param);