No longer using meta table for avatar so edits are reflected immediately.

This commit is contained in:
DebaucheryLibrarian 2024-10-24 22:17:33 +02:00
parent 9e64dd788c
commit 23838889a3
4 changed files with 146 additions and 48 deletions

2
common

@ -1 +1 @@
Subproject commit e55818ab448d463c4765c3394a6049280799ec33
Subproject commit 3bf8ce6e23a1c6c4c909b1a56b201903bad5b26e

View File

@ -103,6 +103,7 @@
<li
v-if="actor.residence"
class="bio-item residence hideable"
:class="{ hideable: !!actor.origin }"
>
<dfn class="bio-label"><Icon icon="location" />Lives in</dfn>
@ -146,14 +147,19 @@
<li
v-if="actor.naturalBoobs === false || actor.naturalButt === false"
class="bio-item augmentations"
class="bio-item augmentations hideable"
>
<dfn class="bio-label"><Icon icon="magic-wand2" />Enhanced</dfn>
<span class="bio-value">
<div
v-if="actor.naturalBoobs === false"
:title="[actor.boobsVolume, augmentationMap[actor.boobsPlacement] || actor.boobsPlacement, augmentationMap[actor.boobsImplant] || actor.boobsImplant].filter(Boolean).join(' ')"
:title="[
actor.boobsVolume && `${actor.boobsVolume}cc`,
augmentationMap[actor.boobsPlacement] || actor.boobsPlacement,
augmentationMap[actor.boobsIncision] || actor.boobsIncision,
augmentationMap[actor.boobsImplant] || actor.boobsImplant
].filter(Boolean).join(' ')"
class="augmentations-section"
>Boobs<template v-if="actor.boobsVolume || actor.boobsImplant">:&nbsp;</template>
<template v-if="actor.boobsVolume">{{ actor.boobsVolume }}cc</template>
@ -167,6 +173,19 @@
<template v-if="actor.buttVolume">{{ actor.buttVolume }}cc</template>
<template v-if="actor.buttImplant">&nbsp;{{ augmentationMap[actor.buttImplant] || actor.buttImplant }}</template>
</div>
<div
v-if="actor.naturalLips === false"
class="augmentations-section"
>Lip filler<template v-if="actor.lipsVolume || actor.lipsImplant">:&nbsp;</template>
<template v-if="actor.lipsVolume">{{ actor.lipsVolume }}cc</template>
<template v-if="actor.lipsImplant">&nbsp;{{ augmentationMap[actor.lipsImplant] || actor.lipsImplant }}</template>
</div>
<div
v-if="actor.naturalLabia === false"
class="augmentations-section"
>Labiaplasty</div>
</span>
</li>
@ -394,6 +413,12 @@ const augmentationMap = {
mms: 'MMS',
over: 'over-muscle',
under: 'under-muscle',
mammary: 'under breast',
areolar: 'areolar',
crescent: 'crescent areolar',
lollipop: 'lollipop',
axillary: 'armpit',
umbilical: 'navel',
};
const descriptions = Object.values(Object.fromEntries(props.actor.profiles
@ -695,7 +720,7 @@ const descriptions = Object.values(Object.fromEntries(props.actor.profiles
justify-content: center;
position: absolute;
z-index: 1;
bottom: -.75rem;
bottom: -.25rem;
}
.expand {
@ -776,6 +801,11 @@ const descriptions = Object.values(Object.fromEntries(props.actor.profiles
&:not(.expanded) .hideable {
display: none;
}
/* only hide update/actions line if other bio lines and thus the expand button are present */
&:not(.expanded) .bio-item + .updated {
display: none;
}
}

View File

@ -360,6 +360,28 @@
</select>
</div>
<div
v-if="edits[item.key].naturalBoobs === false"
class="value-section"
>
<span class="value-label">Incision</span>
<select
v-model="edits[item.key].boobsIncision"
class="input"
:disabled="!editing.has(item.key)"
>
<option :value="null" />
<option value="mammary">Under breast</option>
<option value="areolar">Areola</option>
<option value="crescent">Crescent</option>
<option value="lollipop">Lollipop</option>
<option value="anchor">Anchor</option>
<option value="axillary">Armpit</option>
<option value="umbilical">Navel</option>
</select>
</div>
<div
v-if="edits[item.key].naturalBoobs === false"
class="value-section value-divide"
@ -429,6 +451,51 @@
<option value="lipo">Lipo without BBL</option>
</select>
</div>
<div class="value-section">
<span class="value-label">Natural lips</span>
<select
v-model="edits[item.key].naturalLips"
class="input"
:disabled="!editing.has(item.key)"
>
<option :value="null" />
<option :value="true">Yes</option>
<option :value="false">No</option>
</select>
</div>
<div
v-if="edits[item.key].naturalLips === false"
class="value-section"
>
<span class="value-label">Filler CC</span>
<input
v-model="edits[item.key].lipsVolume"
type="number"
class="volume input"
placeholder="CC"
min="50"
max="10000"
:disabled="!editing.has(item.key)"
>
</div>
<div class="value-section">
<span class="value-label">Natural labia</span>
<select
v-model="edits[item.key].naturalLabia"
class="input"
:disabled="!editing.has(item.key)"
>
<option :value="null" />
<option :value="true">Yes</option>
<option :value="false">No</option>
</select>
</div>
</div>
<div
@ -581,6 +648,8 @@ const user = pageContext.user;
const countries = pageContext.pageProps.countries;
const actor = ref(pageContext.pageProps.actor);
console.log(actor.value);
const topCountries = [
'AU',
'BR',
@ -717,10 +786,14 @@ const fields = computed(() => [
boobsVolume: actor.value.boobsVolume,
boobsImplant: actor.value.boobsImplant,
boobsPlacement: actor.value.boobsPlacement,
boobsIncision: actor.value.boobsIncision,
boobsSurgeon: actor.value.boobsSurgeon,
naturalButt: actor.value.naturalButt,
buttVolume: actor.value.buttVolume,
buttImplant: actor.value.buttImplant,
naturalLips: actor.value.naturalLips,
lipsVolume: actor.value.lipsVolume,
naturalLabia: actor.value.naturalLabia,
},
},
{

View File

@ -22,6 +22,35 @@ import { interpolateProfiles } from '../common/actors.mjs'; // eslint-disable-li
const logger = initLogger();
const mj = new MerkleJson();
const keyMap = {
avatar: 'avatar_media_id',
dateOfBirth: 'date_of_birth',
dateOfDeath: 'date_of_death',
originCountry: 'birth_country_alpha2',
originState: 'birth_state',
originCity: 'birth_city',
residenceCountry: 'residence_country_alpha2',
residenceState: 'residence_state',
residenceCity: 'residence_city',
hairColor: 'hair_color',
naturalBoobs: 'natural_boobs',
boobsVolume: 'boobs_volume',
boobsImplant: 'boobs_implant',
boobsPlacement: 'boobs_placement',
boobsIncision: 'boobs_incision',
boobsSurgeon: 'boobs_surgeon',
naturalButt: 'natural_butt',
buttVolume: 'butt_volume',
buttImplant: 'butt_implant',
naturalLips: 'natural_lips',
lipsVolume: 'lips_volume',
naturalLabia: 'natural_labia',
penisLength: 'penis_length',
penisGirth: 'penis_girth',
hasTattoos: 'has_tattoos',
hasPiercings: 'has_piercings',
};
export function curateActor(actor, context = {}) {
return {
id: actor.id,
@ -29,25 +58,14 @@ export function curateActor(actor, context = {}) {
name: actor.name,
gender: actor.gender,
age: actor.age,
dateOfBirth: actor.date_of_birth,
...Object.fromEntries(Object.entries(keyMap).map(([key, entryKey]) => [key, actor[entryKey]])),
ageFromBirth: actor.date_of_birth && differenceInYears(Date.now(), actor.date_of_birth),
ageThen: context.sceneDate && actor.date_of_birth && differenceInYears(context.sceneDate, actor.date_of_birth),
dateOfDeath: actor.date_of_death,
bust: actor.bust,
cup: actor.cup,
waist: actor.waist,
hip: actor.hip,
naturalBoobs: actor.natural_boobs,
boobsVolume: actor.boobs_volume,
boobsImplant: actor.boobs_implant,
boobsPlacement: actor.boobs_placement,
boobsSurgeon: actor.boobs_surgeon,
naturalButt: actor.natural_butt,
buttVolume: actor.butt_volume,
buttImplant: actor.butt_implant,
penisLength: actor.penis_length,
penisGirth: actor.penis_girth,
isCircumcised: actor.is_circumcised,
circumcised: actor.circumcised,
height: actor.height && {
metric: actor.height,
imperial: unit(actor.height, 'cm').splitUnit(['ft', 'in']).map((value) => Math.round(value.toNumber())),
@ -57,10 +75,7 @@ export function curateActor(actor, context = {}) {
imperial: Math.round(unit(actor.weight, 'kg').toNumeric('lbs')),
},
eyes: actor.eyes,
hairColor: actor.hair_color,
hasTattoos: actor.has_tattoos,
tattoos: actor.tattoos,
hasPiercings: actor.has_piercings,
piercings: actor.piercings,
origin: actor.birth_country_alpha2 && {
country: actor.birth_country_alpha2 && {
@ -130,7 +145,8 @@ export async function fetchActorsById(actorIds, options = {}, reqUser) {
knex('actors')
.select(
'actors.*',
'actors_meta.*',
'actors_meta.stashed',
knex.raw('row_to_json(avatars) as avatar'),
'birth_countries.alpha2 as birth_country_alpha2',
knex.raw('COALESCE(birth_countries.alias, birth_countries.name) as birth_country_name'),
'residence_countries.alpha2 as residence_country_alpha2',
@ -139,6 +155,7 @@ export async function fetchActorsById(actorIds, options = {}, reqUser) {
.leftJoin('actors_meta', 'actors_meta.actor_id', 'actors.id')
.leftJoin('countries as birth_countries', 'birth_countries.alpha2', 'actors.birth_country_alpha2')
.leftJoin('countries as residence_countries', 'residence_countries.alpha2', 'actors.residence_country_alpha2')
.leftJoin('media as avatars', 'avatars.id', 'actors.avatar_media_id')
.whereIn('actors.id', actorIds)
.modify((builder) => {
if (options.order) {
@ -459,32 +476,6 @@ export async function fetchActorRevisions(revisionId, filters = {}, reqUser) {
};
}
const keyMap = {
avatar: 'avatar_media_id',
dateOfBirth: 'date_of_birth',
dateOfDeath: 'date_of_death',
originCountry: 'birth_country_alpha2',
originState: 'birth_state',
originCity: 'birth_city',
residenceCountry: 'residence_country_alpha2',
residenceState: 'residence_state',
residenceCity: 'residence_city',
hairColor: 'hair_color',
naturalBoobs: 'natural_boobs',
boobsVolume: 'boobs_volume',
boobsImplant: 'boobs_implant',
boobsPlacement: 'boobs_placement',
boobsSurgeon: 'boobs_surgeon',
naturalButt: 'natural_butt',
buttVolume: 'butt_volume',
buttImplant: 'butt_implant',
penisLength: 'penis_length',
penisGirth: 'penis_girth',
isCircumcised: 'circumcised',
hasTattoos: 'has_tattoos',
hasPiercings: 'has_piercings',
};
async function applyActorValueDelta(profileId, delta, trx) {
return knex('actors_profiles')
.where('id', profileId)
@ -587,10 +578,14 @@ async function applyActorRevision(revisionIds, reqUser) {
'boobsVolume',
'boobsImplant',
'boobsPlacement',
'boobsIncision',
'boobsSurgeon',
'naturalButt',
'buttVolume',
'buttImplant',
'naturalLips',
'lipsVolume',
'naturalLabia',
'penisLength',
'penisGirth',
'isCircumcised',
@ -631,7 +626,7 @@ async function applyActorRevision(revisionIds, reqUser) {
moment,
slugify,
omit,
});
}, { refreshView: false });
}
export async function reviewActorRevision(revisionId, isApproved, { feedback }, reqUser) {