Fixed empty page breaking Vixen scraper.
This commit is contained in:
@@ -507,8 +507,8 @@ const networks = [
|
||||
|
||||
exports.seed = knex => Promise.resolve()
|
||||
.then(async () => {
|
||||
const { inserted, updated } = await upsert('entities', parentNetworks.map(network => ({ ...network, type: 'network' })), ['slug', 'type'], knex);
|
||||
const parentNetworksBySlug = [].concat(inserted, updated).reduce((acc, network) => ({ ...acc, [network.slug]: network.id }), {});
|
||||
const parentNetworkEntries = await upsert('entities', parentNetworks.map(network => ({ ...network, type: 'network' })), ['slug', 'type'], knex);
|
||||
const parentNetworksBySlug = [].concat(parentNetworkEntries.inserted, parentNetworkEntries.updated).reduce((acc, network) => ({ ...acc, [network.slug]: network.id }), {});
|
||||
|
||||
const networksWithParent = networks.map(network => ({
|
||||
slug: network.slug,
|
||||
@@ -521,5 +521,23 @@ exports.seed = knex => Promise.resolve()
|
||||
parent_id: parentNetworksBySlug[network.parent] || null,
|
||||
}));
|
||||
|
||||
return upsert('entities', networksWithParent, ['slug', 'type'], knex);
|
||||
const networkEntries = await upsert('entities', networksWithParent, ['slug', 'type'], knex);
|
||||
|
||||
const networkIdsBySlug = [].concat(networkEntries.inserted, networkEntries.updated).reduce((acc, network) => ({ ...acc, [network.slug]: network.id }), {});
|
||||
const tagSlugs = networks.map(network => network.tags).flat().filter(Boolean);
|
||||
|
||||
const tagEntries = await knex('tags').whereIn('slug', tagSlugs);
|
||||
const tagIdsBySlug = tagEntries.reduce((acc, tag) => ({ ...acc, [tag.slug]: tag.id }), {});
|
||||
|
||||
const tagAssociations = networks
|
||||
.map(network => (network.tags
|
||||
? network.tags.map(tagSlug => ({
|
||||
entity_id: networkIdsBySlug[network.slug],
|
||||
tag_id: tagIdsBySlug[tagSlug],
|
||||
inherit: true,
|
||||
}))
|
||||
: []))
|
||||
.flat();
|
||||
|
||||
await upsert('entities_tags', tagAssociations, ['entity_id', 'tag_id'], knex);
|
||||
});
|
||||
|
||||
@@ -806,6 +806,7 @@ const tagPhotos = [
|
||||
['fake-boobs', 15, 'Amber Jade and Karma Rx in "Amber In The Hills: Part 1" for Brazzers'],
|
||||
// ['fake-boobs', 6, 'Cathy Heaven in "Heavenly Ass" for Big Wett Butts'],
|
||||
['fake-boobs', 12, 'Nikki Monroe and Kortney Kane for Big Tits In Uniform'],
|
||||
['fake-cum', 3, 'Alexia Anders in "Thanksgiving Creampies" for Cum 4K'],
|
||||
['fake-cum', 0, 'Jynx Maze for Cumshot Surprise (Porn Pros)'],
|
||||
['fake-cum', 1, 'Ricki White for Fucked Up Facials'],
|
||||
['fingering', 2, 'Kylie Page and Hadley Viscara in "Busty Blonde Bombshells" for LesbianX'],
|
||||
|
||||
Reference in New Issue
Block a user