From 7d31dd8d524798b1279110ba7bb44bc341976fba Mon Sep 17 00:00:00 2001 From: Niels Simenon Date: Sun, 28 Jun 2020 00:44:53 +0200 Subject: [PATCH] Fixed seed files for stand-alone channel entities. --- assets/components/entities/entity.vue | 57 +++-- assets/components/entities/tile.vue | 58 +++-- assets/js/entities/actions.js | 6 + migrations/20190325001339_releases.js | 4 +- seeds/02_sites.js | 16 +- seeds/03_studios.js | 309 +++++++++++++------------- 6 files changed, 243 insertions(+), 207 deletions(-) diff --git a/assets/components/entities/entity.vue b/assets/components/entities/entity.vue index 73d7c35a..43f59cb3 100644 --- a/assets/components/entities/entity.vue +++ b/assets/components/entities/entity.vue @@ -4,32 +4,46 @@ class="entity content" >
- + + + + +

{{ entity.parent.name }}

@@ -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%; } diff --git a/assets/components/entities/tile.vue b/assets/components/entities/tile.vue index c1195cb8..61bf8129 100644 --- a/assets/components/entities/tile.vue +++ b/assets/components/entities/tile.vue @@ -4,26 +4,33 @@ :title="entity.name" class="tile" > - + + + @@ -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; } diff --git a/assets/js/entities/actions.js b/assets/js/entities/actions.js index 63ccd08e..04ff1c85 100644 --- a/assets/js/entities/actions.js +++ b/assets/js/entities/actions.js @@ -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 } } } diff --git a/migrations/20190325001339_releases.js b/migrations/20190325001339_releases.js index c6bdaeb4..e0d789dd 100644 --- a/migrations/20190325001339_releases.js +++ b/migrations/20190325001339_releases.js @@ -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()); })) diff --git a/seeds/02_sites.js b/seeds/02_sites.js index 4bad7dd9..a260ad71 100644 --- a/seeds/02_sites.js +++ b/seeds/02_sites.js @@ -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); diff --git a/seeds/03_studios.js b/seeds/03_studios.js index 6994aa35..6c966552 100644 --- a/seeds/03_studios.js +++ b/seeds/03_studios.js @@ -1,166 +1,169 @@ const upsert = require('../src/utils/upsert'); -function getStudios(networksMap) { - return [ - // LegalPorno - { - slug: 'gonzocom', - name: 'Gonzo.com', - url: 'https://www.legalporno.com/studios/gonzo_com', - parent_id: networksMap.legalporno, - }, - { - slug: 'giorgiograndi', - name: 'Giorgio Grandi', - url: 'https://www.legalporno.com/studios/giorgio-grandi', - parent_id: networksMap.legalporno, - }, - { - slug: 'hardpornworld', - name: 'Hard Porn World', - url: 'https://www.legalporno.com/studios/hard-porn-world', - parent_id: networksMap.legalporno, - }, - { - slug: 'interracialvision', - name: 'Interracial Vision', - url: 'https://www.legalporno.com/studios/interracial-vision', - parent_id: networksMap.legalporno, - }, - { - slug: 'giorgioslab', - name: 'Giorgio\'s Lab', - url: 'https://www.legalporno.com/studios/giorgio--s-lab', - parent_id: networksMap.legalporno, - }, - { - slug: 'americananal', - name: 'American Anal', - url: 'https://www.legalporno.com/studios/american-anal', - parent_id: networksMap.legalporno, - }, - { - slug: 'assablanca', - name: 'Assablanca', - url: 'https://www.legalporno.com/studios/assablanca', - parent_id: networksMap.legalporno, - }, - { - slug: 'focus', - name: 'Focus', - url: 'https://www.legalporno.com/studios/focus', - parent_id: networksMap.legalporno, - }, - { - slug: 'analforever', - name: 'Anal Forever', - url: 'https://www.legalporno.com/studios/anal-forever', - parent_id: networksMap.legalporno, - }, - { - slug: 'gonzoinbrazil', - name: 'Gonzo in Brazil', - url: 'https://www.legalporno.com/studios/gonzo-in-brazil', - parent_id: networksMap.legalporno, - }, - { - slug: 'mranal', - name: 'Mr Anal', - url: 'https://www.legalporno.com/studios/mr-anal', - parent_id: networksMap.legalporno, - }, - { - slug: 'tarrawhite', - name: 'Tarra White', - url: 'https://www.legalporno.com/studios/tarra-white', - parent_id: networksMap.legalporno, - }, - { - slug: 'sineplexsos', - name: 'Sineplex SOS', - url: 'https://www.legalporno.com/studios/sineplex-sos', - parent_id: networksMap.legalporno, - }, - { - slug: 'fmodels', - name: 'F Models', - url: 'https://www.legalporno.com/studios/f-models', - parent_id: networksMap.legalporno, - }, - { - slug: 'sineplexcz', - name: 'Sineplex CZ', - url: 'https://www.legalporno.com/studios/sineplex-cz', - parent_id: networksMap.legalporno, - }, - { - slug: 'gg', - name: 'GG', - url: 'https://www.legalporno.com/studios/gg', - parent_id: networksMap.legalporno, - }, - { - slug: 'firstgape', - name: 'First Gape', - url: 'https://www.legalporno.com/studios/first-gape', - parent_id: networksMap.legalporno, - }, - { - slug: 'omargalantiproductions', - name: 'Omar Galanti Productions', - url: 'https://www.legalporno.com/studios/omar-galanti-productions', - parent_id: networksMap.legalporno, - }, - { - slug: 'norestfortheass', - name: 'No Rest For The Ass', - url: 'https://www.legalporno.com/studios/no-rest-for-the-ass', - parent_id: networksMap.legalporno, - }, - { - slug: 'hairygonzo', - name: 'Hairy Gonzo', - url: 'https://www.legalporno.com/studios/hairy-gonzo', - parent_id: networksMap.legalporno, - }, - { - slug: 'sineplexclassic', - name: 'Sineplex Classic', - url: 'https://www.legalporno.com/studios/sineplex-classic', - parent_id: networksMap.legalporno, - }, - { - slug: 'sinemale', - name: 'Sinemale', - url: 'https://www.legalporno.com/studios/sinemale', - parent_id: networksMap.legalporno, - }, - { - slug: 'outsidethestudio', - name: 'Outside The Studio', - url: 'https://www.legalporno.com/studios/outside-the-studio', - parent_id: networksMap.legalporno, - }, - { - slug: 'kinkysex', - name: 'Kinky Sex', - url: 'https://www.legalporno.com/studios/kinky-sex', - parent_id: networksMap.legalporno, - }, - ]; -} +const studios = [ + // LegalPorno + { + slug: 'gonzocom', + name: 'Gonzo.com', + url: 'https://www.legalporno.com/studios/gonzo_com', + parent: 'legalporno', + }, + { + slug: 'giorgiograndi', + name: 'Giorgio Grandi', + url: 'https://www.legalporno.com/studios/giorgio-grandi', + parent: 'legalporno', + }, + { + slug: 'hardpornworld', + name: 'Hard Porn World', + url: 'https://www.legalporno.com/studios/hard-porn-world', + parent: 'legalporno', + }, + { + slug: 'interracialvision', + name: 'Interracial Vision', + url: 'https://www.legalporno.com/studios/interracial-vision', + parent: 'legalporno', + }, + { + slug: 'giorgioslab', + name: 'Giorgio\'s Lab', + url: 'https://www.legalporno.com/studios/giorgio--s-lab', + parent: 'legalporno', + }, + { + slug: 'americananal', + name: 'American Anal', + url: 'https://www.legalporno.com/studios/american-anal', + parent: 'legalporno', + }, + { + slug: 'assablanca', + name: 'Assablanca', + url: 'https://www.legalporno.com/studios/assablanca', + parent: 'legalporno', + }, + { + slug: 'focus', + name: 'Focus', + url: 'https://www.legalporno.com/studios/focus', + parent: 'legalporno', + }, + { + slug: 'analforever', + name: 'Anal Forever', + url: 'https://www.legalporno.com/studios/anal-forever', + parent: 'legalporno', + }, + { + slug: 'gonzoinbrazil', + name: 'Gonzo in Brazil', + url: 'https://www.legalporno.com/studios/gonzo-in-brazil', + parent: 'legalporno', + }, + { + slug: 'mranal', + name: 'Mr Anal', + url: 'https://www.legalporno.com/studios/mr-anal', + parent: 'legalporno', + }, + { + slug: 'tarrawhite', + name: 'Tarra White', + url: 'https://www.legalporno.com/studios/tarra-white', + parent: 'legalporno', + }, + { + slug: 'sineplexsos', + name: 'Sineplex SOS', + url: 'https://www.legalporno.com/studios/sineplex-sos', + parent: 'legalporno', + }, + { + slug: 'fmodels', + name: 'F Models', + url: 'https://www.legalporno.com/studios/f-models', + parent: 'legalporno', + }, + { + slug: 'sineplexcz', + name: 'Sineplex CZ', + url: 'https://www.legalporno.com/studios/sineplex-cz', + parent: 'legalporno', + }, + { + slug: 'gg', + name: 'GG', + url: 'https://www.legalporno.com/studios/gg', + parent: 'legalporno', + }, + { + slug: 'firstgape', + name: 'First Gape', + url: 'https://www.legalporno.com/studios/first-gape', + parent: 'legalporno', + }, + { + slug: 'omargalantiproductions', + name: 'Omar Galanti Productions', + url: 'https://www.legalporno.com/studios/omar-galanti-productions', + parent: 'legalporno', + }, + { + slug: 'norestfortheass', + name: 'No Rest For The Ass', + url: 'https://www.legalporno.com/studios/no-rest-for-the-ass', + parent: 'legalporno', + }, + { + slug: 'hairygonzo', + name: 'Hairy Gonzo', + url: 'https://www.legalporno.com/studios/hairy-gonzo', + parent: 'legalporno', + }, + { + slug: 'sineplexclassic', + name: 'Sineplex Classic', + url: 'https://www.legalporno.com/studios/sineplex-classic', + parent: 'legalporno', + }, + { + slug: 'sinemale', + name: 'Sinemale', + url: 'https://www.legalporno.com/studios/sinemale', + parent: 'legalporno', + }, + { + slug: 'outsidethestudio', + name: 'Outside The Studio', + url: 'https://www.legalporno.com/studios/outside-the-studio', + parent: 'legalporno', + }, + { + slug: 'kinkysex', + name: 'Kinky Sex', + url: 'https://www.legalporno.com/studios/kinky-sex', + 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); });