From 7d84b1ddd21236a277b7a4b874414c49f3daae43 Mon Sep 17 00:00:00 2001 From: winter Date: Thu, 5 Jan 2023 11:53:50 +0100 Subject: [PATCH] remove limit --- src/template_endpoints/song_search.cr | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/template_endpoints/song_search.cr b/src/template_endpoints/song_search.cr index 243a6f3..8503741 100644 --- a/src/template_endpoints/song_search.cr +++ b/src/template_endpoints/song_search.cr @@ -7,13 +7,12 @@ CrystalGauntlet.template_endpoints["/tools/song_search"] = ->(context : HTTP::Se error = nil songs = nil - result_limit = 10 body = context.request.body if body begin params = URI::Params.parse(body.gets_to_end) query = "%#{params["query"]}%" - songs = DATABASE.query_all("select song_data.id, song_authors.name, song_data.name from song_data join song_authors on song_authors.id = song_data.author_id where song_data.id = ? or song_authors.name like ? or song_data.name like ? limit #{result_limit}", params["query"], query, query, as: {Int32, String, String}) + songs = DATABASE.query_all("select song_data.id, song_authors.name, song_data.name from song_data join song_authors on song_authors.id = song_data.author_id where song_data.id = ? or song_authors.name like ? or song_data.name like ?", params["query"], query, query, as: {Int32, String, String}) rescue error ECR.embed("./public/template/song_search.ecr", context.response) else