finish the rest of the filters

This commit is contained in:
Jill 2023-01-05 22:50:59 +03:00
parent 0c6758daf1
commit 62c479660d
1 changed files with 6 additions and 8 deletions

View File

@ -49,14 +49,12 @@ CrystalGauntlet.endpoints["/getGJLevels21.php"] = ->(context : HTTP::Server::Con
queryParams << "epic = 1"
end
if params["uncompleted"]? == "1"
# todo
# $completedLevels = ExploitPatch::numbercolon($_POST["completedLevels"]);
# $params[] = "NOT levelID IN ($completedLevels)";
clean_levels = params["completedLevels"][1..-2].split(",").map { |v| v.to_i }
queryParams << "not levels.id in (#{clean_levels.join(",")})"
end
if params["onlyCompleted"]? == "1"
# todo
# $completedLevels = ExploitPatch::numbercolon($_POST["completedLevels"]);
# $params[] = "levelID IN ($completedLevels)";
clean_levels = params["completedLevels"][1..-2].split(",").map { |v| v.to_i }
queryParams << "levels.id in (#{clean_levels.join(",")})"
end
if params["song"]?
if params["customSong"]? && !params["customSong"].blank?
@ -79,8 +77,8 @@ CrystalGauntlet.endpoints["/getGJLevels21.php"] = ->(context : HTTP::Server::Con
joins << "left join gauntlet_links on gauntlet_links.level_id = levels.id"
queryParams << "gauntlet_id = #{params["gauntlet"].to_i}"
end
if params["len"]?
# todo
if params["len"]? && params["len"]? != "-"
queryParams << "levels.length = #{params["len"].to_i}"
end
if params["diff"]? && params["diff"]? != "-"
case params["diff"]?