Sorting actor tag sections by average tag weight.

This commit is contained in:
2026-07-03 03:59:14 +02:00
parent 5bdcd65d42
commit 469954f613

View File

@@ -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);