Compare commits
No commits in common. "16a5d92efe1370340ca18d1eb3ce788e34e30a91" and "33102367670b7e8cb3114ec85d3283efb9675e6e" have entirely different histories.
16a5d92efe
...
3310236767
|
@ -7,7 +7,7 @@ Use [nvm](https://github.com/creationix/nvm) to install NodeJS v14.15.4 or newer
|
||||||
`npm install`
|
`npm install`
|
||||||
|
|
||||||
### Set up database
|
### Set up database
|
||||||
Install PostgreSQL, make sure password authentication is enabled (scram-sha-256) and create a database with a privileged user.
|
Install PostgreSQL, make sure password authentication is enabled (scram-sha-256) and create a database with a privileged user. For optimal search engine performance, copy `traxxx.stop` to your PostgresQL text search directory, usually `/usr/share/postgresql/tsearch_data/ or `/usr/local/share/postgresql/tsearch_data/`.
|
||||||
|
|
||||||
### Configuration
|
### Configuration
|
||||||
Do not modify `config/default.js`, but instead create a copy at `config/local.js` containing the properties you wish to change. If you have set `NODE_ENV`, copy `assets/js/config/default.js` to `assets/js/config/[environment].js`. After setting up PostgreSQL and configuring the details, run the following commands to create and populate the tables, and build the project:
|
Do not modify `config/default.js`, but instead create a copy at `config/local.js` containing the properties you wish to change. If you have set `NODE_ENV`, copy `assets/js/config/default.js` to `assets/js/config/[environment].js`. After setting up PostgreSQL and configuring the details, run the following commands to create and populate the tables, and build the project:
|
||||||
|
|
|
@ -37,12 +37,7 @@ function initUiActions(_store, _router) {
|
||||||
results: searchReleases(
|
results: searchReleases(
|
||||||
query: $query
|
query: $query
|
||||||
first: $limit
|
first: $limit
|
||||||
orderBy: RANK_DESC
|
minimumRank: "0.025"
|
||||||
filter: {
|
|
||||||
rank: {
|
|
||||||
greaterThan: 0.025
|
|
||||||
}
|
|
||||||
}
|
|
||||||
) {
|
) {
|
||||||
release: releaseById {
|
release: releaseById {
|
||||||
id
|
id
|
||||||
|
|
|
@ -981,8 +981,20 @@ exports.up = knex => Promise.resolve()
|
||||||
.then(() => { // eslint-disable-line arrow-body-style
|
.then(() => { // eslint-disable-line arrow-body-style
|
||||||
// allow vim fold
|
// allow vim fold
|
||||||
return knex.raw(`
|
return knex.raw(`
|
||||||
|
CREATE TEXT SEARCH DICTIONARY traxxx_dict (
|
||||||
|
TEMPLATE = pg_catalog.simple,
|
||||||
|
stopwords = traxxx
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TEXT SEARCH CONFIGURATION traxxx (
|
||||||
|
COPY = english
|
||||||
|
);
|
||||||
|
|
||||||
ALTER TABLE releases_search
|
ALTER TABLE releases_search
|
||||||
ADD COLUMN document tsvector;
|
ADD COLUMN document tsvector;
|
||||||
|
|
||||||
|
ALTER TEXT SEARCH CONFIGURATION traxxx
|
||||||
|
ALTER MAPPING FOR word, numword, hword, numhword, hword_part, hword_numpart, asciiword, asciihword, hword_asciipart WITH traxxx_dict, simple, english_stem;
|
||||||
`);
|
`);
|
||||||
})
|
})
|
||||||
// INDEXES
|
// INDEXES
|
||||||
|
@ -1000,12 +1012,20 @@ exports.up = knex => Promise.resolve()
|
||||||
.then(() => { // eslint-disable-line arrow-body-style
|
.then(() => { // eslint-disable-line arrow-body-style
|
||||||
// allow vim fold
|
// allow vim fold
|
||||||
return knex.raw(`
|
return knex.raw(`
|
||||||
|
CREATE FUNCTION search_releases_legacy(query text) RETURNS SETOF releases AS $$
|
||||||
|
SELECT * FROM releases WHERE releases.id IN (
|
||||||
|
SELECT release_id FROM releases_search AS search
|
||||||
|
WHERE search.document @@ plainto_tsquery('traxxx', regexp_replace(query, '\\.|-|(XXX\\.[\\d+|hd|sd].*$)', ' ', 'ig'))
|
||||||
|
ORDER BY ts_rank(search.document, plainto_tsquery('traxxx', regexp_replace(query, '\\.|-|(XXX\\.[\\d+|hd|sd].*$)', ' ', 'ig'))) DESC
|
||||||
|
);
|
||||||
|
$$ LANGUAGE SQL STABLE;
|
||||||
|
|
||||||
/* We need both the release entries and their search ranking, and PostGraphile does not seem to allow virtual foreign keys on function results.
|
/* We need both the release entries and their search ranking, and PostGraphile does not seem to allow virtual foreign keys on function results.
|
||||||
* Using a view as a proxy for the search results allows us to get both a reference to the releases table, and the ranking */
|
* Using a view as a proxy for the search results allows us to get both a reference to the releases table, and the ranking */
|
||||||
CREATE VIEW releases_search_results AS
|
CREATE VIEW releases_search_results AS
|
||||||
SELECT NULL::integer as id, NULL::real as rank;
|
SELECT NULL::integer as id, NULL::real as rank;
|
||||||
|
|
||||||
CREATE FUNCTION search_releases(query text) RETURNS SETOF releases_search_results AS $$
|
CREATE FUNCTION search_releases(query text, minimum_rank numeric DEFAULT 0) RETURNS SETOF releases_search_results AS $$
|
||||||
SELECT releases.id, ranks.rank FROM (
|
SELECT releases.id, ranks.rank FROM (
|
||||||
SELECT
|
SELECT
|
||||||
releases_search.release_id,
|
releases_search.release_id,
|
||||||
|
@ -1013,7 +1033,7 @@ exports.up = knex => Promise.resolve()
|
||||||
FROM releases_search
|
FROM releases_search
|
||||||
) ranks
|
) ranks
|
||||||
LEFT JOIN releases ON releases.id = ranks.release_id
|
LEFT JOIN releases ON releases.id = ranks.release_id
|
||||||
WHERE ranks.rank > 0
|
WHERE ranks.rank > minimum_rank
|
||||||
ORDER BY ranks.rank DESC;
|
ORDER BY ranks.rank DESC;
|
||||||
$$ LANGUAGE SQL STABLE;
|
$$ LANGUAGE SQL STABLE;
|
||||||
|
|
||||||
|
@ -1179,8 +1199,8 @@ exports.up = knex => Promise.resolve()
|
||||||
COMMENT ON FUNCTION actors_channels IS E'@sortable';
|
COMMENT ON FUNCTION actors_channels IS E'@sortable';
|
||||||
COMMENT ON FUNCTION actors_actors IS E'@sortable';
|
COMMENT ON FUNCTION actors_actors IS E'@sortable';
|
||||||
COMMENT ON FUNCTION actors_scenes IS E'@sortable';
|
COMMENT ON FUNCTION actors_scenes IS E'@sortable';
|
||||||
|
|
||||||
COMMENT ON FUNCTION tags_scenes IS E'@sortable';
|
COMMENT ON FUNCTION tags_scenes IS E'@sortable';
|
||||||
COMMENT ON FUNCTION search_releases IS E'@sortable';
|
|
||||||
|
|
||||||
COMMENT ON VIEW releases_search_results is E'@foreignKey (id) REFERENCES releases (id)';
|
COMMENT ON VIEW releases_search_results is E'@foreignKey (id) REFERENCES releases (id)';
|
||||||
`);
|
`);
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
{
|
{
|
||||||
"name": "traxxx",
|
"name": "traxxx",
|
||||||
"version": "1.175.1",
|
"version": "1.175.0",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"version": "1.175.1",
|
"version": "1.175.0",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@graphile-contrib/pg-order-by-related": "^1.0.0-beta.6",
|
"@graphile-contrib/pg-order-by-related": "^1.0.0-beta.6",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "traxxx",
|
"name": "traxxx",
|
||||||
"version": "1.175.1",
|
"version": "1.175.0",
|
||||||
"description": "All the latest porn releases in one place",
|
"description": "All the latest porn releases in one place",
|
||||||
"main": "src/app.js",
|
"main": "src/app.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
@ -0,0 +1,160 @@
|
||||||
|
i
|
||||||
|
me
|
||||||
|
my
|
||||||
|
myself
|
||||||
|
we
|
||||||
|
our
|
||||||
|
ours
|
||||||
|
ourselves
|
||||||
|
you
|
||||||
|
your
|
||||||
|
yours
|
||||||
|
yourself
|
||||||
|
yourselves
|
||||||
|
he
|
||||||
|
him
|
||||||
|
his
|
||||||
|
himself
|
||||||
|
she
|
||||||
|
her
|
||||||
|
hers
|
||||||
|
herself
|
||||||
|
it
|
||||||
|
its
|
||||||
|
itself
|
||||||
|
they
|
||||||
|
them
|
||||||
|
their
|
||||||
|
theirs
|
||||||
|
themselves
|
||||||
|
what
|
||||||
|
which
|
||||||
|
who
|
||||||
|
whom
|
||||||
|
this
|
||||||
|
that
|
||||||
|
these
|
||||||
|
those
|
||||||
|
am
|
||||||
|
is
|
||||||
|
are
|
||||||
|
was
|
||||||
|
were
|
||||||
|
be
|
||||||
|
been
|
||||||
|
being
|
||||||
|
have
|
||||||
|
has
|
||||||
|
had
|
||||||
|
having
|
||||||
|
do
|
||||||
|
does
|
||||||
|
did
|
||||||
|
doing
|
||||||
|
a
|
||||||
|
an
|
||||||
|
the
|
||||||
|
and
|
||||||
|
but
|
||||||
|
if
|
||||||
|
or
|
||||||
|
because
|
||||||
|
as
|
||||||
|
until
|
||||||
|
while
|
||||||
|
of
|
||||||
|
at
|
||||||
|
by
|
||||||
|
for
|
||||||
|
with
|
||||||
|
about
|
||||||
|
against
|
||||||
|
between
|
||||||
|
into
|
||||||
|
through
|
||||||
|
during
|
||||||
|
before
|
||||||
|
after
|
||||||
|
above
|
||||||
|
below
|
||||||
|
to
|
||||||
|
from
|
||||||
|
up
|
||||||
|
down
|
||||||
|
in
|
||||||
|
out
|
||||||
|
on
|
||||||
|
off
|
||||||
|
over
|
||||||
|
under
|
||||||
|
again
|
||||||
|
further
|
||||||
|
then
|
||||||
|
once
|
||||||
|
here
|
||||||
|
there
|
||||||
|
when
|
||||||
|
where
|
||||||
|
why
|
||||||
|
how
|
||||||
|
all
|
||||||
|
any
|
||||||
|
both
|
||||||
|
each
|
||||||
|
few
|
||||||
|
more
|
||||||
|
most
|
||||||
|
other
|
||||||
|
some
|
||||||
|
such
|
||||||
|
no
|
||||||
|
nor
|
||||||
|
not
|
||||||
|
only
|
||||||
|
own
|
||||||
|
same
|
||||||
|
so
|
||||||
|
than
|
||||||
|
too
|
||||||
|
very
|
||||||
|
s
|
||||||
|
t
|
||||||
|
can
|
||||||
|
will
|
||||||
|
just
|
||||||
|
don
|
||||||
|
should
|
||||||
|
now
|
||||||
|
1080p
|
||||||
|
2160p
|
||||||
|
240p
|
||||||
|
360p
|
||||||
|
480p
|
||||||
|
540p
|
||||||
|
720p
|
||||||
|
avi
|
||||||
|
com
|
||||||
|
gagvid
|
||||||
|
h264
|
||||||
|
hd
|
||||||
|
kleenex
|
||||||
|
ktr
|
||||||
|
mkv
|
||||||
|
mov
|
||||||
|
mp4
|
||||||
|
net
|
||||||
|
rarbg
|
||||||
|
rartv
|
||||||
|
robots
|
||||||
|
scenes
|
||||||
|
sd
|
||||||
|
split
|
||||||
|
tbs
|
||||||
|
trashbin
|
||||||
|
tv
|
||||||
|
web
|
||||||
|
webrip
|
||||||
|
wmv
|
||||||
|
x264
|
||||||
|
xlf
|
||||||
|
xxx
|
Loading…
Reference in New Issue