forked from DebaucheryLibrarian/traxxx
Resolving aliased tag media.
This commit is contained in:
@@ -161,6 +161,7 @@ const tags = [
|
|||||||
name: 'ass to other girl\'s mouth',
|
name: 'ass to other girl\'s mouth',
|
||||||
slug: 'atogm',
|
slug: 'atogm',
|
||||||
description: '[Ass to mouth](/tag/atm) with a cock that has been in someone else\'s ass. ATOGM may also be the gay variation "ass to other guy\'s mouth".',
|
description: '[Ass to mouth](/tag/atm) with a cock that has been in someone else\'s ass. ATOGM may also be the gay variation "ass to other guy\'s mouth".',
|
||||||
|
implies: ['atm'],
|
||||||
group: 'oral',
|
group: 'oral',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -322,6 +323,10 @@ const tags = [
|
|||||||
name: 'bondage',
|
name: 'bondage',
|
||||||
slug: 'bondage',
|
slug: 'bondage',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'bimbo',
|
||||||
|
slug: 'bimbo',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: 'braces',
|
name: 'braces',
|
||||||
slug: 'braces',
|
slug: 'braces',
|
||||||
@@ -557,6 +562,7 @@ const tags = [
|
|||||||
{
|
{
|
||||||
name: 'fake tits',
|
name: 'fake tits',
|
||||||
slug: 'fake-tits',
|
slug: 'fake-tits',
|
||||||
|
description: 'Tasteful enhancements or massive bimbo bolt-ons, you don\'t mind a bit of plastic to get the boobs you\'ve always wanted.',
|
||||||
rename: 'enhanced-boobs',
|
rename: 'enhanced-boobs',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -844,13 +850,18 @@ const tags = [
|
|||||||
name: 'MFM threesome',
|
name: 'MFM threesome',
|
||||||
slug: 'mfm',
|
slug: 'mfm',
|
||||||
implies: ['threesome'],
|
implies: ['threesome'],
|
||||||
description: 'Two men fucking one woman, but not eachother. Typically involves a \'spitroast\', where one guy gets a blowjob and the other fucks her pussy or ass.',
|
description: 'Two men fucking one woman, but not eachother. Typically involves a [spitroast](/tag/spitroast), where one guy gets a blowjob and the other fucks her pussy or ass.',
|
||||||
group: 'group',
|
group: 'group',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'spitroast',
|
name: 'spitroast',
|
||||||
slug: 'spitroast',
|
slug: 'spitroast',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'anal spitroast',
|
||||||
|
slug: 'anal-spitroast',
|
||||||
|
implies: ['anal', 'spitroast'],
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: 'military',
|
name: 'military',
|
||||||
slug: 'military',
|
slug: 'military',
|
||||||
@@ -3141,12 +3152,17 @@ exports.seed = (knex) => Promise.resolve()
|
|||||||
await Promise.all(tags.map((async (tag) => {
|
await Promise.all(tags.map((async (tag) => {
|
||||||
if (tag.rename) {
|
if (tag.rename) {
|
||||||
await knex('tags')
|
await knex('tags')
|
||||||
.where('name', tag.name)
|
.where((builder) => {
|
||||||
|
builder
|
||||||
|
.where('slug', tag.slug)
|
||||||
|
.orWhere('name', tag.name);
|
||||||
|
})
|
||||||
.whereNotNull('alias_for')
|
.whereNotNull('alias_for')
|
||||||
.delete();
|
.delete();
|
||||||
|
|
||||||
await knex('tags')
|
await knex('tags')
|
||||||
.where('slug', tag.rename)
|
.where('slug', tag.rename)
|
||||||
|
.whereNull('alias_for')
|
||||||
.update({
|
.update({
|
||||||
name: tag.name,
|
name: tag.name,
|
||||||
slug: tag.slug,
|
slug: tag.slug,
|
||||||
|
|||||||
@@ -1144,7 +1144,7 @@ exports.seed = (knex) => Promise.resolve()
|
|||||||
entity_id: entitiesBySlug[media.entitySlug]?.id,
|
entity_id: entitiesBySlug[media.entitySlug]?.id,
|
||||||
})), 'path', knex);
|
})), 'path', knex);
|
||||||
|
|
||||||
const tagIdsBySlug = tags.reduce((acc, tag) => ({ ...acc, [tag.slug]: tag.id }), {});
|
const tagIdsBySlug = tags.reduce((acc, tag) => ({ ...acc, [tag.slug]: tag.alias_for || tag.id }), {});
|
||||||
const mediaIdsByPath = inserted.concat(updated).reduce((acc, item) => ({ ...acc, [item.path]: item.id }), {});
|
const mediaIdsByPath = inserted.concat(updated).reduce((acc, item) => ({ ...acc, [item.path]: item.id }), {});
|
||||||
|
|
||||||
const tagMediaBySlug = tagMedia.reduce((acc, tagPhoto) => ({
|
const tagMediaBySlug = tagMedia.reduce((acc, tagPhoto) => ({
|
||||||
|
|||||||
Reference in New Issue
Block a user