Fixed tags module not dealing with empty releases or tags, added origin tag column to chapter tag table.

This commit is contained in:
DebaucheryLibrarian 2021-10-17 00:28:13 +02:00
parent b1b2ad2111
commit 167df35d37
5 changed files with 19 additions and 9 deletions

View File

@ -1,7 +1,10 @@
<template> <template>
<div class="tags"> <div class="tags">
<div class="content-inner"> <div class="content-inner">
<SearchBar :placeholder="'Search tags'" /> <SearchBar
:placeholder="'Search tags'"
class="search"
/>
<div <div
v-for="(tags, category) in categories" v-for="(tags, category) in categories"
@ -65,10 +68,9 @@ const tagSlugsByCategory = {
'blowjob', 'blowjob',
'pussy-eating', 'pussy-eating',
'ass-eating', 'ass-eating',
'69',
'double-blowjob',
'deepthroat', 'deepthroat',
'facefucking', 'facefucking',
'69',
'atm', 'atm',
], ],
manual: [ manual: [
@ -89,7 +91,6 @@ const tagSlugsByCategory = {
], ],
cumshot: [ cumshot: [
'facial', 'facial',
'bukkake',
'creampie', 'creampie',
'cum-in-mouth', 'cum-in-mouth',
'cum-on-boobs', 'cum-on-boobs',
@ -97,6 +98,7 @@ const tagSlugsByCategory = {
'cum-on-pussy', 'cum-on-pussy',
'anal-creampie', 'anal-creampie',
'oral-creampie', 'oral-creampie',
'bukkake',
'fake-cum', 'fake-cum',
], ],
toys: [ toys: [
@ -226,19 +228,22 @@ export default {
display: grid; display: grid;
grid-template-columns: repeat(auto-fill, minmax(20rem, .33fr)); grid-template-columns: repeat(auto-fill, minmax(20rem, .33fr));
grid-gap: 1rem; grid-gap: 1rem;
margin: 0 0 1.5rem 0;
} }
.heading { .heading {
text-transform: capitalize; text-transform: capitalize;
padding: 0 0 0 .5rem; padding: 0 0 0 .5rem;
margin: 1.75rem 0 1rem 0; margin: 1.25rem 0 1rem 0;
} }
.category:first-child .heading { .category:first-child .heading {
margin: .5rem 0 1rem 0; margin: .5rem 0 1rem 0;
} }
.search {
margin: 0 0 .25rem 0;
}
@media(max-width: $breakpoint3) { @media(max-width: $breakpoint3) {
.tiles { .tiles {
grid-template-columns: repeat(auto-fill, minmax(18rem, .5fr)); grid-template-columns: repeat(auto-fill, minmax(18rem, .5fr));

View File

@ -986,7 +986,6 @@ exports.up = knex => Promise.resolve()
})) }))
.then(() => knex.schema.createTable('chapters_tags', (table) => { .then(() => knex.schema.createTable('chapters_tags', (table) => {
table.integer('tag_id', 12) table.integer('tag_id', 12)
.notNullable()
.references('id') .references('id')
.inTable('tags') .inTable('tags')
.onDelete('cascade'); .onDelete('cascade');
@ -997,6 +996,8 @@ exports.up = knex => Promise.resolve()
.inTable('chapters') .inTable('chapters')
.onDelete('cascade'); .onDelete('cascade');
table.text('original_tag');
table.unique(['tag_id', 'chapter_id']); table.unique(['tag_id', 'chapter_id']);
})) }))
.then(() => knex.schema.createTable('users_roles', (table) => { .then(() => knex.schema.createTable('users_roles', (table) => {

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

View File

@ -836,6 +836,7 @@ const tagMedia = [
['enhanced-boobs', 'trudy_photodromm_1', 'Trudy', 'photodromm'], ['enhanced-boobs', 'trudy_photodromm_1', 'Trudy', 'photodromm'],
['enhanced-boobs', 'kenzie_anne_playboy', 'Miss Kenzie Anne in "Supercharged"', 'playboy'], ['enhanced-boobs', 'kenzie_anne_playboy', 'Miss Kenzie Anne in "Supercharged"', 'playboy'],
['enhanced-boobs', 'kelly_oliveira_teenfidelity', 'Kelly Oliveira in "Keep It Going"', 'teenfidelity'], ['enhanced-boobs', 'kelly_oliveira_teenfidelity', 'Kelly Oliveira in "Keep It Going"', 'teenfidelity'],
['enhanced-boobs', 13, 'Kitana Lure', 'assholefever'],
['enhanced-boobs', 9, 'Putri Cinta', 'watch4beauty'], ['enhanced-boobs', 9, 'Putri Cinta', 'watch4beauty'],
['enhanced-boobs', 'alexis_zara_wildoncam', 'Alexis Zara', 'wildoncam'], ['enhanced-boobs', 'alexis_zara_wildoncam', 'Alexis Zara', 'wildoncam'],
['enhanced-boobs', 'diamond_foxxx_brazzers_1', 'Diamond Foxxx in "Big Cock Inheritor"', 'brazzers'], ['enhanced-boobs', 'diamond_foxxx_brazzers_1', 'Diamond Foxxx in "Big Cock Inheritor"', 'brazzers'],
@ -857,7 +858,6 @@ const tagMedia = [
['enhanced-boobs', 10, 'Tia Cyrus in "Titty-Fucked Yoga Goddess"', 'latinasextapes'], ['enhanced-boobs', 10, 'Tia Cyrus in "Titty-Fucked Yoga Goddess"', 'latinasextapes'],
['enhanced-boobs', 24, 'Shalina Devine in "Rumbling in the Ring, Part 2"', 'pornworld'], ['enhanced-boobs', 24, 'Shalina Devine in "Rumbling in the Ring, Part 2"', 'pornworld'],
['enhanced-boobs', 20, 'Chloe Lamour', 'ddfbusty'], ['enhanced-boobs', 20, 'Chloe Lamour', 'ddfbusty'],
['enhanced-boobs', 13, 'Kitana Lure', 'assholefever'],
['enhanced-boobs', 8, 'Amber Alena', 'score'], ['enhanced-boobs', 8, 'Amber Alena', 'score'],
['enhanced-boobs', 19, 'Kerrie Lee in "Bricked"', 'studio66tv'], ['enhanced-boobs', 19, 'Kerrie Lee in "Bricked"', 'studio66tv'],
['enhanced-boobs', 4, 'Capri Cavanni', 'bigtitsinsports'], ['enhanced-boobs', 4, 'Capri Cavanni', 'bigtitsinsports'],

View File

@ -117,7 +117,7 @@ async function getEntityTags(releases) {
function buildReleaseTagAssociations(releases, tagIdsBySlug, entityTagIdsByEntityId, type) { function buildReleaseTagAssociations(releases, tagIdsBySlug, entityTagIdsByEntityId, type) {
const tagAssociations = releases const tagAssociations = releases
.map((release) => { .map((release) => {
const entityTagIds = entityTagIdsByEntityId[release.entity?.id].map(tag => ({ id: tag.id, origin: tag.name })) || []; const entityTagIds = entityTagIdsByEntityId[release.entity?.id]?.map(tag => ({ id: tag.id, origin: tag.name })) || [];
const releaseTags = release.tags?.filter(Boolean) || []; const releaseTags = release.tags?.filter(Boolean) || [];
const releaseTagsWithIds = releaseTags.every(tag => typeof tag === 'number') const releaseTagsWithIds = releaseTags.every(tag => typeof tag === 'number')
@ -147,6 +147,10 @@ function buildReleaseTagAssociations(releases, tagIdsBySlug, entityTagIdsByEntit
} }
async function associateReleaseTags(releases, type = 'release') { async function associateReleaseTags(releases, type = 'release') {
if (releases.length === 0) {
return;
}
const tagIdsBySlug = await matchReleaseTags(releases); const tagIdsBySlug = await matchReleaseTags(releases);
const EntityTagIdsByEntityId = await getEntityTags(releases); const EntityTagIdsByEntityId = await getEntityTags(releases);