From afe587616274ca4fc1f3338f7dee0ae56f718081 Mon Sep 17 00:00:00 2001 From: DebaucheryLibrarian Date: Tue, 9 Jun 2026 04:22:41 +0200 Subject: [PATCH] Implemented global match actor form edit. --- common | 2 +- pages/actors/edit/+Page.vue | 9 ++++++--- src/actors.js | 4 +++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/common b/common index 71b58d5..ec0812a 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit 71b58d50999bd05a958b85aa95a2fb6dcb5a5f98 +Subproject commit ec0812ad9d0f46b29c3ca214cf1ae324bfdbfdb5 diff --git a/pages/actors/edit/+Page.vue b/pages/actors/edit/+Page.vue index c674866..faa54c6 100644 --- a/pages/actors/edit/+Page.vue +++ b/pages/actors/edit/+Page.vue @@ -520,7 +520,7 @@ const fields = computed(() => [ key: 'tattoos', type: 'has', value: { - has: actor.value?.hasTattoos || null, + has: actor.value?.hasTattoos ?? null, description: actor.value?.tattoos || null, }, }, @@ -529,7 +529,7 @@ const fields = computed(() => [ type: 'has', note: 'Excludes earrings', value: { - has: actor.value?.hasPiercings || null, + has: actor.value?.hasPiercings ?? null, description: actor.value?.piercings || null, }, }, @@ -576,7 +576,7 @@ const fields = computed(() => [ note: 'Allow this actor to be assigned to scenes automatically, overriding single-name protections.', hasDescription: false, value: { - has: actor.value?.isGlobal || null, + has: actor.value?.allowGlobalMatch ?? null, }, }, ] @@ -630,6 +630,9 @@ const keyMap = { has: 'hasPiercings', description: 'piercings', }, + allowGlobalMatch: { + has: 'allowGlobalMatch', + }, }; const groupMap = { diff --git a/src/actors.js b/src/actors.js index bf760cc..de1cbc7 100644 --- a/src/actors.js +++ b/src/actors.js @@ -56,6 +56,7 @@ const keyMap = { hasTattoos: 'has_tattoos', hasPiercings: 'has_piercings', isCircumcised: 'circumcised', + allowGlobalMatch: 'allow_global_match', }; const socialsOrder = ['onlyfans', 'fansly', 'twitter', 'instagram', 'loyalfans', 'manyvids', 'pornhub', 'linktree', null]; @@ -131,6 +132,7 @@ export function curateActor(actor, context = {}) { ...actor.avatar, sfw_media: actor.sfw_avatar, }), + allowGlobalMatch: actor.allow_global_match, socials: context.socials?.map((social) => ({ id: social.id, url: social.url, @@ -816,7 +818,7 @@ async function applyActorRevision(revisionIds, reqUser) { return applyActorSocialsDelta(revision.actor_id, delta, trx); } - if (delta.key === 'name' && reqUser.role === 'admin') { + if (['name', 'allowGlobalMatch'].includes(delta.key) && verifyAbility(reqUser, 'actor', 'update')) { return applyActorDirectDelta(revision.actor_id, delta, trx); }