Compare commits

..

No commits in common. "cefd91a7b9832a38b398c66ffc1351b489a67d97" and "60eb5994160ba3b967c6ce00628bf47d88cd468f" have entirely different histories.

3 changed files with 4 additions and 11 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "traxxx", "name": "traxxx",
"version": "1.137.4", "version": "1.137.3",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

View File

@ -1,6 +1,6 @@
{ {
"name": "traxxx", "name": "traxxx",
"version": "1.137.4", "version": "1.137.3",
"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": {

View File

@ -13,11 +13,6 @@ function curateEntity(entity, includeParameters = false) {
return null; return null;
} }
const logo = (entity.has_logo
&& (((entity.independent || entity.type === 'network') && `${entity.slug}/network.png`)
|| (entity.parent && `${entity.parent.slug}/${entity.slug}.png`)))
|| null;
const curatedEntity = entity.id ? { const curatedEntity = entity.id ? {
id: entity.id, id: entity.id,
name: entity.name, name: entity.name,
@ -25,9 +20,7 @@ function curateEntity(entity, includeParameters = false) {
description: entity.description, description: entity.description,
slug: entity.slug, slug: entity.slug,
type: entity.type, type: entity.type,
independent: !!entity.independent,
aliases: entity.alias, aliases: entity.alias,
logo,
parent: curateEntity(entity.parent, includeParameters), parent: curateEntity(entity.parent, includeParameters),
} : {}; } : {};
@ -183,7 +176,7 @@ async function fetchEntities(type, limit) {
async function searchEntities(query, type, limit) { async function searchEntities(query, type, limit) {
const entities = await knex const entities = await knex
.select(knex.raw(` .select(knex.raw(`
entities.id, entities.name, entities.slug, entities.type, entities.url, entities.description, entities.alias, entities.has_logo, entities.id, entities.name, entities.slug, entities.type, entities.url, entities.description, entities.alias,
COALESCE(json_agg(tags) FILTER (WHERE tags.id IS NOT NULL), '[]') as tags, COALESCE(json_agg(tags) FILTER (WHERE tags.id IS NOT NULL), '[]') as tags,
row_to_json(parents) as parent row_to_json(parents) as parent
`)) `))
@ -196,7 +189,7 @@ async function searchEntities(query, type, limit) {
.leftJoin('entities as parents', 'parents.id', 'entities.parent_id') .leftJoin('entities as parents', 'parents.id', 'entities.parent_id')
.leftJoin('entities_tags', 'entities_tags.entity_id', 'entities.id') .leftJoin('entities_tags', 'entities_tags.entity_id', 'entities.id')
.leftJoin('tags', 'tags.id', 'entities_tags.tag_id') .leftJoin('tags', 'tags.id', 'entities_tags.tag_id')
.groupBy('entities.id', 'entities.name', 'entities.slug', 'entities.type', 'entities.url', 'entities.description', 'entities.alias', 'entities.has_logo', 'parents.id') .groupBy('entities.id', 'entities.name', 'entities.slug', 'entities.type', 'entities.url', 'entities.description', 'entities.alias', 'parents.id')
.limit(limit || 100); .limit(limit || 100);
return curateEntities(entities); return curateEntities(entities);