Make filters really work

This commit is contained in:
emeric
2018-02-05 13:39:45 +01:00
parent 1e470a34b1
commit cea01d06b7
14 changed files with 187 additions and 18 deletions
+11 -2
View File
@@ -111,7 +111,7 @@ Track::getClusters(void) const
static
Wt::Dbo::Query< Track::pointer >
getQuery(Wt::Dbo::Session& session,
const std::vector<id_type>& clusterIds,
const std::set<id_type>& clusterIds,
const std::vector<std::string> keywords)
{
WhereClause where;
@@ -165,7 +165,7 @@ Track::getStats(Wt::Dbo::Session& session, SearchFilter filter)
std::vector<Track::pointer>
Track::getByFilter(Wt::Dbo::Session& session,
const std::vector<id_type>& clusterIds,
const std::set<id_type>& clusterIds,
const std::vector<std::string> keywords,
int offset, int size, bool& moreResults)
{
@@ -282,6 +282,15 @@ Cluster::getQuery(Wt::Dbo::Session& session, SearchFilter filter)
return query;
}
std::vector<std::string>
Cluster::getAllTypes(Wt::Dbo::Session& session)
{
Wt::Dbo::collection<std::string> res
= session.query<std::string>("SELECT type from cluster").groupBy("type").orderBy("type");
return std::vector<std::string>(res.begin(), res.end());
}
std::vector<Cluster::pointer>
Cluster::getByFilter(Wt::Dbo::Session& session, SearchFilter filter, int offset, int size)
{