Added S3 support for media files. Fixed MindGeek scraper for new poster data structure.

This commit is contained in:
DebaucheryLibrarian
2021-02-22 02:33:39 +01:00
parent 9a65d8c0eb
commit 37e39dc1ec
17 changed files with 152 additions and 79 deletions

View File

@@ -28,6 +28,9 @@ exports.up = knex => Promise.resolve()
table.integer('index');
table.text('mime');
table.boolean('is_s3')
.defaultTo(false);
table.text('hash');
table.bigInteger('size', 12);
@@ -1020,17 +1023,17 @@ exports.up = knex => Promise.resolve()
CREATE FUNCTION search_entities(search text) RETURNS SETOF entities AS $$
SELECT * FROM entities
WHERE
name ILIKE ('%' || search || '%') OR
slug ILIKE ('%' || search || '%') OR
array_to_string(alias, '') ILIKE ('%' || search || '%') OR
replace(array_to_string(alias, ''), ' ', '') ILIKE ('%' || search || '%') OR
name ILIKE ('%' || TRIM(search) || '%') OR
slug ILIKE ('%' || TRIM(search) || '%') OR
array_to_string(alias, '') ILIKE ('%' || TRIM(search) || '%') OR
replace(array_to_string(alias, ''), ' ', '') ILIKE ('%' || TRIM(search) || '%') OR
url ILIKE ('%' || search || '%')
$$ LANGUAGE SQL STABLE;
CREATE FUNCTION search_actors(search text, min_length numeric DEFAULT 2) RETURNS SETOF actors AS $$
SELECT * FROM actors
WHERE length(search) >= min_length
AND name ILIKE ('%' || search || '%')
AND name ILIKE ('%' || TRIM(search) || '%')
$$ LANGUAGE SQL STABLE;
CREATE FUNCTION actors_tags(actor actors, selectable_tags text[]) RETURNS SETOF tags AS $$