From 469954f61364b0f61217c7a0eaf40d64ae051661 Mon Sep 17 00:00:00 2001 From: DebaucheryLibrarian Date: Fri, 3 Jul 2026 03:59:14 +0200 Subject: [PATCH] Sorting actor tag sections by average tag weight. --- pages/scene/+Page.vue | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pages/scene/+Page.vue b/pages/scene/+Page.vue index 417edda..91e68dc 100644 --- a/pages/scene/+Page.vue +++ b/pages/scene/+Page.vue @@ -459,7 +459,14 @@ const tags = [ actor, tags: scene.tags.filter((tag) => tag.actorId === actor.id), })), -].filter((actorTags) => actorTags.tags.length > 0); +] + .filter((actorTags) => actorTags.tags.length > 0) + .toSorted((actorTagsA, actorTagsB) => { + const priorityA = actorTagsA.tags.reduce((acc, tag) => acc + tag.priority, 0) / actorTagsA.tags.length; + const priorityB = actorTagsB.tags.reduce((acc, tag) => acc + tag.priority, 0) / actorTagsB.tags.length; + + return priorityB - priorityA; + }); const showSummaryDialog = ref(false);