Sorting actor tag sections by average tag weight.
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user