Commit 4e34ce5d authored by Kevin Whitaker's avatar Kevin Whitaker

limit results at the sql level.

parent f389ebaf
......@@ -140,7 +140,7 @@ void RequestInterface::searchClicked()
}
//Do a like search on title, artist, and album on DB
Wt::Dbo::collection<Wt::Dbo::ptr<AudioTrack>> trackOptions = sqlSession.find<AudioTrack>(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<Wt::Dbo::ptr<AudioTrack>> trackOptions = sqlSession.find<AudioTrack>(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();
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment