AlbumListQuery will also apply the filter to artist name as well. Improves

the user experience while filtering albums.
This commit is contained in:
casey langen 2017-02-12 13:59:58 -08:00
parent c506d69fde
commit e8985aadd1

View File

@ -70,7 +70,7 @@ static const std::string TABLES =
"albums, tracks, artists ";
static const std::string FILTER_PREDICATE =
" LOWER(album) like ? AND ";
" (LOWER(album) like ? OR LOWER(album_artist) like ?) AND ";
static const std::string CATEGORY_PREDICATE =
" tracks.%s=? AND ";
@ -127,10 +127,6 @@ bool AlbumListQuery::OnRun(Connection& db) {
Statement stmt(query.c_str(), db);
if (filtered) {
}
int bindIndex = 0;
if (filtered) {
@ -139,6 +135,7 @@ bool AlbumListQuery::OnRun(Connection& db) {
std::transform(wild.begin(), wild.end(), wild.begin(), tolower);
wild = "%" + wild + "%";
stmt.BindText(bindIndex++, wild);
stmt.BindText(bindIndex++, wild);
}
if (category) {