From f69836ad09d10c154fd9f1dd64d0924920cec32f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C4=85tkowski?= Date: Wed, 10 Aug 2022 01:04:29 +0200 Subject: [PATCH] Fix sorting by relevance --- cmd/magneticow/data/static/scripts/torrents.js | 7 +++++-- cmd/magneticow/data/templates/torrents.html | 2 ++ pkg/persistence/postgres.go | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/cmd/magneticow/data/static/scripts/torrents.js b/cmd/magneticow/data/static/scripts/torrents.js index 5b9f03e..c81d4dd 100644 --- a/cmd/magneticow/data/static/scripts/torrents.js +++ b/cmd/magneticow/data/static/scripts/torrents.js @@ -41,15 +41,18 @@ window.onload = function () { query = queryInput.value switch (sortDropdown.selectedIndex) { case 0: + setOrderBy("RELEVANCE") + break; case 1: + case 2: setOrderBy("TOTAL_SIZE") break; - case 2: case 3: + case 4: setOrderBy("DISCOVERED_ON") break; - case 4: case 5: + case 6: setOrderBy("N_FILES") break; } diff --git a/cmd/magneticow/data/templates/torrents.html b/cmd/magneticow/data/templates/torrents.html index 9621f16..fdefbaf 100644 --- a/cmd/magneticow/data/templates/torrents.html +++ b/cmd/magneticow/data/templates/torrents.html @@ -1,4 +1,5 @@ + @@ -30,6 +31,7 @@
magneticow(pre-alpha)