Fixed seed files for stand-alone channel entities.
This commit is contained in:
parent
3462d7af2a
commit
7d31dd8d52
|
@ -4,6 +4,7 @@
|
|||
class="entity content"
|
||||
>
|
||||
<div class="info">
|
||||
<template v-if="entity.hasLogo">
|
||||
<img
|
||||
v-if="$route.name === 'network'"
|
||||
class="logo"
|
||||
|
@ -21,15 +22,28 @@
|
|||
class="logo"
|
||||
:src="`/img/logos/${entity.slug}/thumbs/${entity.slug}.png`"
|
||||
>
|
||||
</template>
|
||||
|
||||
<h2
|
||||
v-else
|
||||
class="name"
|
||||
>{{ entity.name }}</h2>
|
||||
|
||||
<router-link
|
||||
v-if="entity.parent"
|
||||
:to="`/${entity.parent.type}/${entity.parent.slug}`"
|
||||
class="link parent-link"
|
||||
>
|
||||
<img
|
||||
v-if="entity.parent.hasLogo"
|
||||
class="logo logo-parent"
|
||||
:src="`/img/logos/${entity.parent.slug}/thumbs/network.png`"
|
||||
>
|
||||
|
||||
<h3
|
||||
v-else
|
||||
class="name parent-name"
|
||||
>{{ entity.parent.name }}</h3>
|
||||
</router-link>
|
||||
</div>
|
||||
|
||||
|
@ -136,6 +150,12 @@ export default {
|
|||
padding: 1rem;
|
||||
background: var(--profile);
|
||||
border-bottom: solid 1px var(--lighten-hint);
|
||||
|
||||
.link {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
|
||||
.logo {
|
||||
|
@ -146,6 +166,15 @@ export default {
|
|||
object-position: 0 50%;
|
||||
}
|
||||
|
||||
.name {
|
||||
color: var(--text-light);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
.logo-parent {
|
||||
object-position: 100% 50%;
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
:title="entity.name"
|
||||
class="tile"
|
||||
>
|
||||
<template v-if="entity.hasLogo">
|
||||
<img
|
||||
v-if="entity.type === 'network'"
|
||||
:src="`/img/logos/${entity.slug}/thumbs/network.png`"
|
||||
|
@ -24,6 +25,12 @@
|
|||
:alt="entity.name"
|
||||
class="logo"
|
||||
>
|
||||
</template>
|
||||
|
||||
<span
|
||||
v-else
|
||||
class="name"
|
||||
>{{ entity.name }}</span>
|
||||
</router-link>
|
||||
</template>
|
||||
|
||||
|
@ -53,29 +60,20 @@ export default {
|
|||
border-radius: .25rem;
|
||||
box-shadow: 0 0 3px rgba(0, 0, 0, .25);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.link {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.logo {
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
color: $text-contrast;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 1rem;
|
||||
font-weight: bold;
|
||||
filter: $logo-highlight;
|
||||
}
|
||||
|
||||
.title {
|
||||
color: $text;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin: 0;
|
||||
.name {
|
||||
color: var(--text-light);
|
||||
font-size: 1.25rem;
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -32,6 +32,7 @@ function initEntitiesActions(store, _router) {
|
|||
name
|
||||
slug
|
||||
url
|
||||
hasLogo
|
||||
children: childEntities(
|
||||
orderBy: [PRIORITY_DESC, NAME_ASC],
|
||||
) {
|
||||
|
@ -41,6 +42,7 @@ function initEntitiesActions(store, _router) {
|
|||
url
|
||||
type
|
||||
priority
|
||||
hasLogo
|
||||
}
|
||||
parent {
|
||||
id
|
||||
|
@ -48,6 +50,7 @@ function initEntitiesActions(store, _router) {
|
|||
slug
|
||||
type
|
||||
url
|
||||
hasLogo
|
||||
}
|
||||
}
|
||||
connection: releasesConnection(
|
||||
|
@ -143,6 +146,7 @@ function initEntitiesActions(store, _router) {
|
|||
slug
|
||||
type
|
||||
url
|
||||
hasLogo
|
||||
}
|
||||
}
|
||||
`, {
|
||||
|
@ -167,11 +171,13 @@ function initEntitiesActions(store, _router) {
|
|||
slug
|
||||
type
|
||||
url
|
||||
hasLogo
|
||||
parent {
|
||||
name
|
||||
slug
|
||||
type
|
||||
url
|
||||
hasLogo
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -174,10 +174,12 @@ exports.up = knex => Promise.resolve()
|
|||
table.text('description');
|
||||
table.json('parameters');
|
||||
|
||||
table.boolean('active');
|
||||
table.integer('priority', 3)
|
||||
.defaultTo(0);
|
||||
|
||||
table.boolean('has_logo')
|
||||
.defaultTo(true);
|
||||
|
||||
table.datetime('created_at')
|
||||
.defaultTo(knex.fn.now());
|
||||
}))
|
||||
|
|
|
@ -1157,7 +1157,6 @@ const sites = [
|
|||
url: 'https://www.sunlustxxx.com',
|
||||
description: '',
|
||||
parent: 'blowpass',
|
||||
active: true, // site offline, use only for indexing old scenes
|
||||
},
|
||||
// BOOBPEDIA
|
||||
{
|
||||
|
@ -1555,6 +1554,7 @@ const sites = [
|
|||
url: 'https://www.digitalplayground.com/scenes?site=206',
|
||||
description: '',
|
||||
parent: 'digitalplayground',
|
||||
hasLogo: false,
|
||||
},
|
||||
{
|
||||
slug: 'flixxx',
|
||||
|
@ -1583,6 +1583,7 @@ const sites = [
|
|||
url: 'https://www.digitalplayground.com/scenes?site=211',
|
||||
description: '',
|
||||
parent: 'digitalplayground',
|
||||
hasLogo: false,
|
||||
},
|
||||
{
|
||||
slug: 'dpparodies',
|
||||
|
@ -1875,7 +1876,6 @@ const sites = [
|
|||
description: 'Welcome the official Daring Sex site, home of high quality erotica, sensual porn and hardcore exploration of the darker side of sexuality. Here you will find a variety of videos for lovers looking for a bit of extra, or something darker with an element of control.',
|
||||
parent: 'famedigital',
|
||||
parameters: { api: true },
|
||||
active: false, // no data sources
|
||||
},
|
||||
{
|
||||
slug: 'peternorth',
|
||||
|
@ -4928,7 +4928,6 @@ const sites = [
|
|||
slug: 'bigboobbundle',
|
||||
url: 'https://www.bigboobbundle.com',
|
||||
parent: 'score',
|
||||
active: false, // all content appears to be on subsites
|
||||
},
|
||||
{
|
||||
name: 'Big Boobs POV',
|
||||
|
@ -5220,7 +5219,6 @@ const sites = [
|
|||
slug: 'milfbundle',
|
||||
url: 'https://www.milfbundle.com',
|
||||
parent: 'score',
|
||||
active: false,
|
||||
},
|
||||
{
|
||||
name: 'Teaming Cock',
|
||||
|
@ -5287,7 +5285,6 @@ const sites = [
|
|||
slug: 'pornmegaload',
|
||||
url: 'https://www.pornmegaload.com',
|
||||
parent: 'score',
|
||||
active: false,
|
||||
},
|
||||
{
|
||||
name: 'SaRennas World',
|
||||
|
@ -5325,7 +5322,6 @@ const sites = [
|
|||
url: 'https://www.scorepass.com/scorelandtv',
|
||||
parent: 'score',
|
||||
priority: 1,
|
||||
active: false, // appears to be streaming service for other sites
|
||||
},
|
||||
{
|
||||
name: 'ScoreTV',
|
||||
|
@ -5333,7 +5329,6 @@ const sites = [
|
|||
url: 'https://www.scoretv.tv',
|
||||
parent: 'score',
|
||||
priority: 1,
|
||||
active: false, // similar to or same as Scoreland TV
|
||||
},
|
||||
{
|
||||
name: 'Score Videos',
|
||||
|
@ -6366,7 +6361,10 @@ const sites = [
|
|||
/* eslint-disable max-len */
|
||||
exports.seed = knex => Promise.resolve()
|
||||
.then(async () => {
|
||||
const networks = await knex('entities').where('type', 'network');
|
||||
const networks = await knex('entities')
|
||||
.where('type', 'network')
|
||||
.orWhereNull('parent_id');
|
||||
|
||||
const networksMap = networks.reduce((acc, { id, slug }) => ({ ...acc, [slug]: id }), {});
|
||||
|
||||
const tags = await knex('tags').select('*').where('alias_for', null);
|
||||
|
@ -6382,7 +6380,7 @@ exports.seed = knex => Promise.resolve()
|
|||
parameters: site.parameters,
|
||||
parent_id: networksMap[site.parent],
|
||||
priority: site.priority,
|
||||
active: site.show,
|
||||
has_logo: site.hasLogo,
|
||||
}));
|
||||
|
||||
const { inserted, updated } = await upsert('entities', sitesWithNetworks, ['slug', 'type'], knex);
|
||||
|
|
|
@ -1,166 +1,169 @@
|
|||
const upsert = require('../src/utils/upsert');
|
||||
|
||||
function getStudios(networksMap) {
|
||||
return [
|
||||
const studios = [
|
||||
// LegalPorno
|
||||
{
|
||||
slug: 'gonzocom',
|
||||
name: 'Gonzo.com',
|
||||
url: 'https://www.legalporno.com/studios/gonzo_com',
|
||||
parent_id: networksMap.legalporno,
|
||||
parent: 'legalporno',
|
||||
},
|
||||
{
|
||||
slug: 'giorgiograndi',
|
||||
name: 'Giorgio Grandi',
|
||||
url: 'https://www.legalporno.com/studios/giorgio-grandi',
|
||||
parent_id: networksMap.legalporno,
|
||||
parent: 'legalporno',
|
||||
},
|
||||
{
|
||||
slug: 'hardpornworld',
|
||||
name: 'Hard Porn World',
|
||||
url: 'https://www.legalporno.com/studios/hard-porn-world',
|
||||
parent_id: networksMap.legalporno,
|
||||
parent: 'legalporno',
|
||||
},
|
||||
{
|
||||
slug: 'interracialvision',
|
||||
name: 'Interracial Vision',
|
||||
url: 'https://www.legalporno.com/studios/interracial-vision',
|
||||
parent_id: networksMap.legalporno,
|
||||
parent: 'legalporno',
|
||||
},
|
||||
{
|
||||
slug: 'giorgioslab',
|
||||
name: 'Giorgio\'s Lab',
|
||||
url: 'https://www.legalporno.com/studios/giorgio--s-lab',
|
||||
parent_id: networksMap.legalporno,
|
||||
parent: 'legalporno',
|
||||
},
|
||||
{
|
||||
slug: 'americananal',
|
||||
name: 'American Anal',
|
||||
url: 'https://www.legalporno.com/studios/american-anal',
|
||||
parent_id: networksMap.legalporno,
|
||||
parent: 'legalporno',
|
||||
},
|
||||
{
|
||||
slug: 'assablanca',
|
||||
name: 'Assablanca',
|
||||
url: 'https://www.legalporno.com/studios/assablanca',
|
||||
parent_id: networksMap.legalporno,
|
||||
parent: 'legalporno',
|
||||
},
|
||||
{
|
||||
slug: 'focus',
|
||||
name: 'Focus',
|
||||
url: 'https://www.legalporno.com/studios/focus',
|
||||
parent_id: networksMap.legalporno,
|
||||
parent: 'legalporno',
|
||||
},
|
||||
{
|
||||
slug: 'analforever',
|
||||
name: 'Anal Forever',
|
||||
url: 'https://www.legalporno.com/studios/anal-forever',
|
||||
parent_id: networksMap.legalporno,
|
||||
parent: 'legalporno',
|
||||
},
|
||||
{
|
||||
slug: 'gonzoinbrazil',
|
||||
name: 'Gonzo in Brazil',
|
||||
url: 'https://www.legalporno.com/studios/gonzo-in-brazil',
|
||||
parent_id: networksMap.legalporno,
|
||||
parent: 'legalporno',
|
||||
},
|
||||
{
|
||||
slug: 'mranal',
|
||||
name: 'Mr Anal',
|
||||
url: 'https://www.legalporno.com/studios/mr-anal',
|
||||
parent_id: networksMap.legalporno,
|
||||
parent: 'legalporno',
|
||||
},
|
||||
{
|
||||
slug: 'tarrawhite',
|
||||
name: 'Tarra White',
|
||||
url: 'https://www.legalporno.com/studios/tarra-white',
|
||||
parent_id: networksMap.legalporno,
|
||||
parent: 'legalporno',
|
||||
},
|
||||
{
|
||||
slug: 'sineplexsos',
|
||||
name: 'Sineplex SOS',
|
||||
url: 'https://www.legalporno.com/studios/sineplex-sos',
|
||||
parent_id: networksMap.legalporno,
|
||||
parent: 'legalporno',
|
||||
},
|
||||
{
|
||||
slug: 'fmodels',
|
||||
name: 'F Models',
|
||||
url: 'https://www.legalporno.com/studios/f-models',
|
||||
parent_id: networksMap.legalporno,
|
||||
parent: 'legalporno',
|
||||
},
|
||||
{
|
||||
slug: 'sineplexcz',
|
||||
name: 'Sineplex CZ',
|
||||
url: 'https://www.legalporno.com/studios/sineplex-cz',
|
||||
parent_id: networksMap.legalporno,
|
||||
parent: 'legalporno',
|
||||
},
|
||||
{
|
||||
slug: 'gg',
|
||||
name: 'GG',
|
||||
url: 'https://www.legalporno.com/studios/gg',
|
||||
parent_id: networksMap.legalporno,
|
||||
parent: 'legalporno',
|
||||
},
|
||||
{
|
||||
slug: 'firstgape',
|
||||
name: 'First Gape',
|
||||
url: 'https://www.legalporno.com/studios/first-gape',
|
||||
parent_id: networksMap.legalporno,
|
||||
parent: 'legalporno',
|
||||
},
|
||||
{
|
||||
slug: 'omargalantiproductions',
|
||||
name: 'Omar Galanti Productions',
|
||||
url: 'https://www.legalporno.com/studios/omar-galanti-productions',
|
||||
parent_id: networksMap.legalporno,
|
||||
parent: 'legalporno',
|
||||
},
|
||||
{
|
||||
slug: 'norestfortheass',
|
||||
name: 'No Rest For The Ass',
|
||||
url: 'https://www.legalporno.com/studios/no-rest-for-the-ass',
|
||||
parent_id: networksMap.legalporno,
|
||||
parent: 'legalporno',
|
||||
},
|
||||
{
|
||||
slug: 'hairygonzo',
|
||||
name: 'Hairy Gonzo',
|
||||
url: 'https://www.legalporno.com/studios/hairy-gonzo',
|
||||
parent_id: networksMap.legalporno,
|
||||
parent: 'legalporno',
|
||||
},
|
||||
{
|
||||
slug: 'sineplexclassic',
|
||||
name: 'Sineplex Classic',
|
||||
url: 'https://www.legalporno.com/studios/sineplex-classic',
|
||||
parent_id: networksMap.legalporno,
|
||||
parent: 'legalporno',
|
||||
},
|
||||
{
|
||||
slug: 'sinemale',
|
||||
name: 'Sinemale',
|
||||
url: 'https://www.legalporno.com/studios/sinemale',
|
||||
parent_id: networksMap.legalporno,
|
||||
parent: 'legalporno',
|
||||
},
|
||||
{
|
||||
slug: 'outsidethestudio',
|
||||
name: 'Outside The Studio',
|
||||
url: 'https://www.legalporno.com/studios/outside-the-studio',
|
||||
parent_id: networksMap.legalporno,
|
||||
parent: 'legalporno',
|
||||
},
|
||||
{
|
||||
slug: 'kinkysex',
|
||||
name: 'Kinky Sex',
|
||||
url: 'https://www.legalporno.com/studios/kinky-sex',
|
||||
parent_id: networksMap.legalporno,
|
||||
parent: 'legalporno',
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
/* eslint-disable max-len */
|
||||
exports.seed = knex => Promise.resolve()
|
||||
.then(async () => {
|
||||
const networks = await knex('entities').select('*').where('type', 'network');
|
||||
const networks = await knex('entities')
|
||||
.whereIn('slug', studios.map(studio => studio.parent));
|
||||
|
||||
const networksMap = networks.reduce((acc, { id, slug }) => ({ ...acc, [slug]: id }), {});
|
||||
|
||||
const studios = getStudios(networksMap).map(studio => ({
|
||||
...studio,
|
||||
const studiosWithNetwork = studios.map(studio => ({
|
||||
slug: studio.slug,
|
||||
name: studio.name,
|
||||
url: studio.url,
|
||||
type: 'studio',
|
||||
parent_id: networksMap[studio.parent],
|
||||
has_logo: studio.hasLogo || false,
|
||||
}));
|
||||
|
||||
return upsert('entities', studios, 'slug', knex);
|
||||
return upsert('entities', studiosWithNetwork, 'slug', knex);
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue