Compare commits

..

No commits in common. "89a729924d3e8a3e44a1ad16e866db960df1fe5d" and "ab83dd2e55f919b7176a3de01672ca3f64d40d4e" have entirely different histories.

4 changed files with 14 additions and 8 deletions

2
package-lock.json generated
View File

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

View File

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

View File

@ -199,11 +199,7 @@ async function fetchReleaseEntities(baseReleases) {
FROM entity_tree
JOIN entities ON entity_tree.parent_id = entities.id
)
SELECT jsonb_set(entity, '{children}', to_jsonb(COALESCE(json_agg(children) FILTER (WHERE children.id IS NOT NULL), '[]'))) entity
FROM entity_tree
LEFT JOIN entities AS children ON children.parent_id = (entity->>'id')::int
WHERE entity_tree.parent_id IS NULL
GROUP BY entity_tree.entity
SELECT entity FROM entity_tree WHERE parent_id is null
ORDER BY entity->'type' ASC;
`, { entitySlugs });

View File

@ -1,9 +1,17 @@
'use strict';
const blake2 = require('blake2');
const knex = require('../knex');
const qu = require('../utils/qu');
async function getSiteSlugs() {
return knex('entities')
.pluck('entities.slug')
.join('entities AS parents', 'parents.id', 'entities.parent_id')
.where('parents.slug', 'perfectgonzo');
}
function getHash(identifier) {
const hash = blake2.createHash('blake2b', { digestLength: 8 });
@ -31,7 +39,9 @@ function extractMaleModelsFromTags(tagContainer) {
}
async function extractChannelFromPhoto(photo, channel) {
const siteSlugs = (channel.type === 'network' ? channel.children : channel.parent?.children)?.map(child => child.slug);
const siteSlugs = (channel.type === 'network' ? channel.children : channel.parent?.children)?.map(child => child.slug)
|| await getSiteSlugs();
const channelMatch = photo.match(new RegExp(siteSlugs.join('|')));
if (channelMatch) {