Compare commits

..

No commits in common. "cefd91a7b9832a38b398c66ffc1351b489a67d97" and "2f8fca03276a23d35331fae1c43a52661dcc2cb3" have entirely different histories.

5 changed files with 8 additions and 18 deletions

2
package-lock.json generated
View File

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

View File

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

View File

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

View File

@ -146,7 +146,7 @@ const { argv } = yargs
describe: 'Limit amount of scenes when dates are missing.',
type: 'number',
default: config.noDateLimit,
alias: ['null-date-limit', 'limit'],
alias: ['no-date-limit', 'null-date-limit', 'limit'],
})
.option('page', {
describe: 'Page to start scraping at',

View File

@ -13,11 +13,6 @@ function curateEntity(entity, includeParameters = false) {
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 ? {
id: entity.id,
name: entity.name,
@ -25,9 +20,6 @@ function curateEntity(entity, includeParameters = false) {
description: entity.description,
slug: entity.slug,
type: entity.type,
independent: !!entity.independent,
aliases: entity.alias,
logo,
parent: curateEntity(entity.parent, includeParameters),
} : {};
@ -140,9 +132,8 @@ async function fetchEntity(entityId, type) {
if (type) {
queryBuilder
.where('entities.type', type)
.where('entities.slug', entityId)
.orWhere(knex.raw(':entityId = ANY(entities.alias)', { entityId }));
.where('entities.type', type);
return;
}
@ -181,9 +172,9 @@ async function fetchEntities(type, limit) {
}
async function searchEntities(query, type, limit) {
const entities = await knex
const entities = knex
.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,
COALESCE(json_agg(tags) FILTER (WHERE tags.id IS NOT NULL), '[]') as tags,
row_to_json(parents) as parent
`))
@ -196,10 +187,10 @@ async function searchEntities(query, type, limit) {
.leftJoin('entities as parents', 'parents.id', 'entities.parent_id')
.leftJoin('entities_tags', 'entities_tags.entity_id', 'entities.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', 'parents.id')
.limit(limit || 100);
return curateEntities(entities);
return curateEntities(await entities);
}
async function flushEntities(networkSlugs = [], channelSlugs = []) {