Compare commits
No commits in common. "f4b1fb4831129a7adc6fda90ba9da25c0bad1d51" and "64a52fbb1e31027d8e3458469a9ba33a46bccf1b" have entirely different histories.
f4b1fb4831
...
64a52fbb1e
|
@ -61,10 +61,6 @@ module.exports = {
|
||||||
// mindgeek
|
// mindgeek
|
||||||
'pornhub',
|
'pornhub',
|
||||||
],
|
],
|
||||||
networks: [
|
|
||||||
// dummy network for testing
|
|
||||||
'traxxx',
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
profiles: [
|
profiles: [
|
||||||
[
|
[
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "traxxx",
|
"name": "traxxx",
|
||||||
"version": "1.138.7",
|
"version": "1.138.5",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "traxxx",
|
"name": "traxxx",
|
||||||
"version": "1.138.7",
|
"version": "1.138.5",
|
||||||
"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": {
|
||||||
|
|
|
@ -696,14 +696,11 @@ async function scrapeActors(argNames) {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getOrCreateActors(baseActors, batchId) {
|
async function getOrCreateActors(baseActors, batchId) {
|
||||||
// WHERE IN causes stack depth error and performance issues with a large amount of values, no knex VALUES helper available
|
const existingActors = await knex('actors')
|
||||||
const actorValues = baseActors.map(actor => knex.raw('(:slug, :entityId)', { slug: actor.slug, entityId: actor.entity.id })).join(', ');
|
.select('id', 'alias_for', 'name', 'slug', 'entity_id')
|
||||||
|
.whereIn('slug', baseActors.map(baseActor => baseActor.slug))
|
||||||
const existingActors = await knex
|
.whereNull('entity_id')
|
||||||
.select('actors.*')
|
.orWhereIn(['slug', 'entity_id'], baseActors.map(baseActor => [baseActor.slug, baseActor.entity.id]));
|
||||||
.from(knex.raw(`actors, (VALUES ${actorValues}) AS base_actors (slug, entity_id)`))
|
|
||||||
.whereRaw('actors.slug = base_actors.slug AND actors.entity_id IS NULL')
|
|
||||||
.orWhereRaw('actors.slug = base_actors.slug AND actors.entity_id = base_actors.entity_id');
|
|
||||||
|
|
||||||
// const existingActorSlugs = new Set(existingActors.map(actor => actor.slug));
|
// const existingActorSlugs = new Set(existingActors.map(actor => actor.slug));
|
||||||
const existingActorSlugs = existingActors.reduce((acc, actor) => ({
|
const existingActorSlugs = existingActors.reduce((acc, actor) => ({
|
||||||
|
|
Loading…
Reference in New Issue