summaryrefslogtreecommitdiff
path: root/lib/VNWeb/Releases
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2020-11-28 19:36:09 +0100
committerYorhel <git@yorhel.nl>2020-11-28 19:36:14 +0100
commitdd2762e6afab7cf33794c3d95bcfc8c9506702a1 (patch)
treeff3f2a0ffe7c964a65a719f14c3d25ab1d4fa930 /lib/VNWeb/Releases
parent8323430e739893d0899e92aa77097120861d1c43 (diff)
AdvSearch: Add resolution autocomplete
Using a lazily loaded static list
Diffstat (limited to 'lib/VNWeb/Releases')
-rw-r--r--lib/VNWeb/Releases/Elm.pm8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/VNWeb/Releases/Elm.pm b/lib/VNWeb/Releases/Elm.pm
index f4ab8975..7f0578e4 100644
--- a/lib/VNWeb/Releases/Elm.pm
+++ b/lib/VNWeb/Releases/Elm.pm
@@ -10,4 +10,12 @@ elm_api Release => undef, { vid => { id => 1 } }, sub {
elm_Releases releases_by_vn $data->{vid};
};
+
+elm_api Resolutions => undef, {}, sub {
+ elm_Resolutions [ map +{ resolution => resolution($_), count => $_->{count} }, tuwf->dbAlli(q{
+ SELECT reso_x, reso_y, count(*) AS count FROM releases WHERE NOT hidden AND NOT (reso_x = 0 AND reso_y = 0)
+ GROUP BY reso_x, reso_y ORDER BY count(*) DESC
+ })->@* ];
+};
+
1;