Use DAAP collation for group queries

This commit is contained in:
Kai Elwert 2010-08-29 10:23:00 +02:00 committed by Julien BLACHE
parent f79dbc93cb
commit b5e3163d35
1 changed files with 4 additions and 4 deletions

View File

@ -917,13 +917,13 @@ db_build_query_groups(struct query_params *qp, char **q)
return -1;
if (idx && qp->filter)
query = sqlite3_mprintf("SELECT COUNT(*), g.id, g.persistentid, f.album_artist, g.name FROM files f JOIN groups g ON f.songalbumid = g.persistentid GROUP BY f.album COLLATE NOCASE, g.name HAVING g.type = %d AND disabled = 0 AND %s %s;", G_ALBUMS, qp->filter, idx);
query = sqlite3_mprintf("SELECT COUNT(*), g.id, g.persistentid, f.album_artist, g.name FROM files f JOIN groups g ON f.songalbumid = g.persistentid GROUP BY f.album COLLATE DAAP, g.name HAVING g.type = %d AND disabled = 0 AND %s %s;", G_ALBUMS, qp->filter, idx);
else if (idx)
query = sqlite3_mprintf("SELECT COUNT(*), g.id, g.persistentid, f.album_artist, g.name FROM files f JOIN groups g ON f.songalbumid = g.persistentid GROUP BY f.album COLLATE NOCASE, g.name HAVING g.type = %d AND disabled = 0 %s;", G_ALBUMS, idx);
query = sqlite3_mprintf("SELECT COUNT(*), g.id, g.persistentid, f.album_artist, g.name FROM files f JOIN groups g ON f.songalbumid = g.persistentid GROUP BY f.album COLLATE DAAP, g.name HAVING g.type = %d AND disabled = 0 %s;", G_ALBUMS, idx);
else if (qp->filter)
query = sqlite3_mprintf("SELECT COUNT(*), g.id, g.persistentid, f.album_artist, g.name FROM files f JOIN groups g ON f.songalbumid = g.persistentid GROUP BY f.album COLLATE NOCASE, g.name HAVING g.type = %d AND disabled = 0 AND %s;", G_ALBUMS, qp->filter);
query = sqlite3_mprintf("SELECT COUNT(*), g.id, g.persistentid, f.album_artist, g.name FROM files f JOIN groups g ON f.songalbumid = g.persistentid GROUP BY f.album COLLATE DAAP, g.name HAVING g.type = %d AND disabled = 0 AND %s;", G_ALBUMS, qp->filter);
else
query = sqlite3_mprintf("SELECT COUNT(*), g.id, g.persistentid, f.album_artist, g.name FROM files f JOIN groups g ON f.songalbumid = g.persistentid GROUP BY f.album COLLATE NOCASE, g.name HAVING g.type = %d AND disabled = 0;", G_ALBUMS);
query = sqlite3_mprintf("SELECT COUNT(*), g.id, g.persistentid, f.album_artist, g.name FROM files f JOIN groups g ON f.songalbumid = g.persistentid GROUP BY f.album COLLATE DAAP, g.name HAVING g.type = %d AND disabled = 0;", G_ALBUMS);
if (!query)
{