Compare commits

...

2 Commits

Author SHA1 Message Date
DebaucheryLibrarian 8e7b944b52 1.137.3 2020-10-20 00:21:25 +02:00
DebaucheryLibrarian 6b17f9d1f2 Allowing entity to be fetched by alias. 2020-10-20 00:21:15 +02:00
4 changed files with 6 additions and 3 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "traxxx", "name": "traxxx",
"version": "1.137.2", "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.2", "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

@ -6,6 +6,7 @@ const parentNetworks = [
slug: 'gamma', slug: 'gamma',
name: 'Gamma Entertainment', name: 'Gamma Entertainment',
url: 'https://www.gammaentertainment.com', url: 'https://www.gammaentertainment.com',
alias: ['gammaentertainment'],
}, },
{ {
slug: 'hush', slug: 'hush',

View File

@ -20,6 +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,
aliases: entity.alias,
parent: curateEntity(entity.parent, includeParameters), parent: curateEntity(entity.parent, includeParameters),
} : {}; } : {};
@ -132,8 +133,9 @@ async function fetchEntity(entityId, type) {
if (type) { if (type) {
queryBuilder queryBuilder
.where('entities.type', type)
.where('entities.slug', entityId) .where('entities.slug', entityId)
.where('entities.type', type); .orWhere(knex.raw(':entityId = ANY(entities.alias)', { entityId }));
return; return;
} }