Implement sort=artist for DAAP queries

This commit is contained in:
Kai Elwert 2010-10-09 15:57:34 +02:00 committed by Julien BLACHE
parent ee7b976eeb
commit e5af78fe9f
3 changed files with 4 additions and 0 deletions

View File

@ -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;

View File

@ -20,6 +20,7 @@ enum sort_type {
S_NONE = 0,
S_NAME,
S_ALBUM,
S_ARTIST,
};
#define Q_F_BROWSE (1 << 15)

View File

@ -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);