Compare commits

..

No commits in common. "b96d996947f7014d5e330025f9e96093adf1fbd9" and "31e884359ec84331f263d46bc8950af0f36f50b5" have entirely different histories.

7 changed files with 62 additions and 80 deletions

View File

@ -20,13 +20,13 @@ export default {
components: {
EntityTile,
},
emits: ['load'],
props: {
entity: {
type: Object,
default: null,
},
},
emits: ['load'],
};
</script>

View File

@ -11,8 +11,7 @@ exports.up = async () => {
await utilsApi.sql(`create table scenes (
id int,
title text,
title_filtered text,
shoot_id text,
entry_id text,
channel_id int,
channel_name text,
channel_slug text,

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "traxxx",
"version": "1.236.1",
"version": "1.236.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "traxxx",
"version": "1.236.1",
"version": "1.236.0",
"license": "ISC",
"dependencies": {
"@aws-sdk/client-s3": "^3.458.0",

View File

@ -1,6 +1,6 @@
{
"name": "traxxx",
"version": "1.236.1",
"version": "1.236.0",
"description": "All the latest porn releases in one place",
"main": "src/app.js",
"scripts": {

View File

@ -1302,8 +1302,8 @@ const aliases = [
for: 'atogm',
},
{
name: 'atom',
for: 'atogm',
name: 'ass to other mouth',
for: 'atom',
},
{
name: 'atm',

View File

@ -3,7 +3,6 @@
const config = require('config');
const manticore = require('manticoresearch');
const args = require('yargs').argv;
const { format } = require('date-fns');
const knex = require('../knex');
@ -25,7 +24,7 @@ async function fetchScenes() {
scenes_meta.title,
scenes_meta.created_at,
scenes_meta.date,
scenes_meta.shoot_id,
scenes_meta.entry_id,
scenes_meta.stashed,
entities.id as channel_id,
entities.slug as channel_slug,
@ -34,7 +33,7 @@ async function fetchScenes() {
parents.slug as network_slug,
parents.name as network_name,
COALESCE(JSON_AGG(DISTINCT (actors.id, actors.name)) FILTER (WHERE actors.id IS NOT NULL), '[]') as actors,
COALESCE(JSON_AGG(DISTINCT (tags.id, tags.name, tags.priority, tags_aliases.name)) FILTER (WHERE tags.id IS NOT NULL), '[]') as tags
COALESCE(JSON_AGG(DISTINCT (tags.id, tags.name)) FILTER (WHERE tags.id IS NOT NULL), '[]') as tags
FROM scenes_meta
LEFT JOIN entities ON scenes_meta.entity_id = entities.id
LEFT JOIN entities AS parents ON parents.id = entities.parent_id
@ -43,14 +42,14 @@ async function fetchScenes() {
LEFT JOIN releases_tags AS local_tags ON local_tags.release_id = scenes_meta.id
LEFT JOIN actors ON local_actors.actor_id = actors.id
LEFT JOIN actors AS directors ON local_directors.director_id = directors.id
LEFT JOIN tags ON local_tags.tag_id = tags.id
LEFT JOIN tags ON local_tags.tag_id = tags.id AND tags.priority >= 6
LEFT JOIN tags as tags_aliases ON local_tags.tag_id = tags_aliases.alias_for AND tags_aliases.secondary = true
GROUP BY
scenes_meta.id,
scenes_meta.title,
scenes_meta.created_at,
scenes_meta.date,
scenes_meta.shoot_id,
scenes_meta.entry_id,
scenes_meta.stashed,
entities.id,
entities.name,
@ -71,8 +70,7 @@ async function init() {
await utilsApi.sql(`create table scenes (
id int,
title text,
title_filtered text,
shoot_id text,
entry_id text,
channel_id int,
channel_name text,
channel_slug text,
@ -92,22 +90,16 @@ async function init() {
const scenes = await fetchScenes();
const docs = scenes.map((scene) => {
const flatActors = scene.actors.flatMap((actor) => actor.f2.match(/[\w']+/g)); // match word characters to filter out brackets etc.
const flatTags = scene.tags.filter((tag) => tag.f3 > 6).flatMap((tag) => (tag.f4 ? `${tag.f2} ${tag.f4}` : tag.f2).match(/[\w']+/g)); // only make top tags searchable to minimize cluttered results
const filteredTitle = scene.title && [...flatActors, ...flatTags].reduce((accTitle, tag) => accTitle.replace(new RegExp(tag, 'i'), ''), scene.title).trim().replace(/\s{2,}/, ' ');
return {
const docs = scenes.map((scene) => ({
replace: {
index: 'scenes',
id: scene.id,
doc: {
title: scene.title || undefined,
title_filtered: filteredTitle || undefined,
date: scene.date ? Math.round(scene.date.getTime() / 1000) : undefined,
created_at: Math.round(scene.created_at.getTime() / 1000),
effective_date: Math.round((scene.date || scene.created_at).getTime() / 1000),
shoot_id: scene.shoot_id || undefined,
entry_id: scene.entry_id,
channel_id: scene.channel_id,
channel_slug: scene.channel_slug,
channel_name: scene.channel_name,
@ -117,13 +109,11 @@ async function init() {
actor_ids: scene.actors.map((actor) => actor.f1),
actors: scene.actors.map((actor) => actor.f2).join(),
tag_ids: scene.tags.map((tag) => tag.f1),
tags: flatTags.join(' '),
meta: scene.date ? format(scene.date, 'y yy M MMM MMMM d') : undefined,
tags: scene.tags.map((tag) => tag.f2).join(),
stashed: scene.stashed || 0,
},
},
};
});
}));
const data = await indexApi.bulk(docs.map((doc) => JSON.stringify(doc)).join('\n'));

View File

@ -17,7 +17,7 @@ async function updateManticoreSearch(releaseIds) {
scenes_meta.title,
scenes_meta.created_at,
scenes_meta.date,
scenes_meta.shoot_id,
scenes_meta.entry_id,
scenes_meta.stashed,
entities.id as channel_id,
entities.slug as channel_slug,
@ -26,7 +26,7 @@ async function updateManticoreSearch(releaseIds) {
parents.slug as network_slug,
parents.name as network_name,
COALESCE(JSON_AGG(DISTINCT (actors.id, actors.name)) FILTER (WHERE actors.id IS NOT NULL), '[]') as actors,
COALESCE(JSON_AGG(DISTINCT (tags.id, tags.name, tags.priority)) FILTER (WHERE tags.id IS NOT NULL), '[]') as tags
COALESCE(JSON_AGG(DISTINCT (tags.id, tags.name)) FILTER (WHERE tags.id IS NOT NULL), '[]') as tags
FROM scenes_meta
LEFT JOIN entities ON scenes_meta.entity_id = entities.id
LEFT JOIN entities AS parents ON parents.id = entities.parent_id
@ -43,7 +43,7 @@ async function updateManticoreSearch(releaseIds) {
scenes_meta.title,
scenes_meta.created_at,
scenes_meta.date,
scenes_meta.shoot_id,
scenes_meta.entry_id,
scenes_meta.stashed,
entities.id,
entities.name,
@ -55,22 +55,16 @@ async function updateManticoreSearch(releaseIds) {
parents.alias;
`, releaseIds && [releaseIds]);
const docs = scenes.rows.map((scene) => {
const flatActors = scene.actors.flatMap((actor) => actor.f2.split(' '));
const flatTags = scene.tags.filter((tag) => tag.f3 > 6).flatMap((tag) => tag.f2.split(' ')); // only make top tags searchable to minimize cluttered results
const filteredTitle = scene.title && [...flatActors, ...flatTags].reduce((accTitle, tag) => accTitle.replace(new RegExp(tag, 'i'), ''), scene.title).trim().replace(/\s{2,}/, ' ');
return {
const docs = scenes.rows.map((scene) => ({
replace: {
index: 'scenes',
id: scene.id,
doc: {
title: scene.title || undefined,
title_filtered: filteredTitle || undefined,
date: scene.date ? Math.round(scene.date.getTime() / 1000) : undefined,
created_at: Math.round(scene.created_at.getTime() / 1000),
effective_date: Math.round((scene.date || scene.created_at).getTime() / 1000),
shoot_id: scene.shoot_id || undefined,
entry_id: scene.entry_id,
channel_id: scene.channel_id,
channel_slug: scene.channel_slug,
channel_name: scene.channel_name,
@ -80,13 +74,12 @@ async function updateManticoreSearch(releaseIds) {
actor_ids: scene.actors.map((actor) => actor.f1),
actors: scene.actors.map((actor) => actor.f2).join(),
tag_ids: scene.tags.map((tag) => tag.f1),
tags: scene.tags.filter((tag) => tag.f3 > 6).map((tag) => tag.f2).join(), // only make top tags searchable to minimize cluttered results
meta: scene.date ? format(scene.date, 'y yy M MMM MMMM d') : undefined,
tags: scene.tags.map((tag) => tag.f2).join(),
meta: scene.date ? format(scene.date, 'y M d') : undefined,
stashed: scene.stashed || 0,
},
},
};
});
}));
if (docs.length === 0) {
return;