Added children to deep release entity, removed database dependency from Perfect Gonzo scraper.
This commit is contained in:
@@ -1,17 +1,9 @@
|
||||
'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 });
|
||||
|
||||
@@ -39,9 +31,7 @@ function extractMaleModelsFromTags(tagContainer) {
|
||||
}
|
||||
|
||||
async function extractChannelFromPhoto(photo, channel) {
|
||||
const siteSlugs = (channel.type === 'network' ? channel.children : channel.parent?.children)?.map(child => child.slug)
|
||||
|| await getSiteSlugs();
|
||||
|
||||
const siteSlugs = (channel.type === 'network' ? channel.children : channel.parent?.children)?.map(child => child.slug);
|
||||
const channelMatch = photo.match(new RegExp(siteSlugs.join('|')));
|
||||
|
||||
if (channelMatch) {
|
||||
|
||||
Reference in New Issue
Block a user