Added pagination and search to movies page.

This commit is contained in:
DebaucheryLibrarian
2021-08-22 00:40:22 +02:00
parent 5e292a0880
commit 4b18867883
55 changed files with 274 additions and 103 deletions

View File

@@ -1418,6 +1418,12 @@ exports.up = knex => Promise.resolve()
ORDER BY ranks.rank DESC;
$$ LANGUAGE SQL STABLE;
CREATE FUNCTION search_movies(query text, min_length smallint DEFAULT 2) RETURNS SETOF movies AS $$
SELECT * FROM movies
WHERE length(query) >= min_length
AND title ILIKE ('%' || TRIM(query) || '%')
$$ LANGUAGE SQL STABLE;
CREATE FUNCTION search_entities(search text) RETURNS SETOF entities AS $$
SELECT * FROM entities
WHERE
@@ -1719,8 +1725,10 @@ exports.up = knex => Promise.resolve()
COMMENT ON FUNCTION actors_actors IS E'@sortable';
COMMENT ON FUNCTION actors_scenes IS E'@sortable';
COMMENT ON FUNCTION tags_scenes IS E'@sortable';
COMMENT ON FUNCTION search_releases IS E'@sortable';
COMMENT ON FUNCTION search_actors IS E'@sortable';
COMMENT ON FUNCTION search_movies IS E'@sortable';
COMMENT ON FUNCTION search_tags IS E'@sortable';
`);
});