From 4e34ce5d21946cf2d12866aa07d339c88b5714b8 Mon Sep 17 00:00:00 2001 From: Kevin Whitaker Date: Thu, 23 Feb 2017 21:58:20 -0500 Subject: [PATCH] limit results at the sql level. --- src/ui/RequestInterface.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ui/RequestInterface.cpp b/src/ui/RequestInterface.cpp index e45b2da..e84a2fb 100644 --- a/src/ui/RequestInterface.cpp +++ b/src/ui/RequestInterface.cpp @@ -140,7 +140,7 @@ void RequestInterface::searchClicked() } //Do a like search on title, artist, and album on DB - Wt::Dbo::collection> trackOptions = sqlSession.find(std::string("where tracks.name like \"%")+searchBox->text().toUTF8()+std::string("%\" OR tracks.artist like \"%")+searchBox->text().toUTF8()+std::string("%\" OR tracks.album like \"%")+searchBox->text().toUTF8()+std::string("%\"")); + Wt::Dbo::collection> trackOptions = sqlSession.find(std::string("where tracks.name like \"%")+searchBox->text().toUTF8()+std::string("%\" OR tracks.artist like \"%")+searchBox->text().toUTF8()+std::string("%\" OR tracks.album like \"%")+searchBox->text().toUTF8()+std::string("%\"")).limit(49); //Make sure all items are gone for(RequestItem* item: foundItems) @@ -167,7 +167,7 @@ void RequestInterface::searchClicked() } else { - searchBox->setText("Not enough/too many results"); + searchBox->setText("Not enough results"); } searchTransaction.commit(); } -- GitLab