Added avatar credit exclusion to profile interpolation.

This commit is contained in:
2026-02-07 17:19:20 +01:00
parent ec4b15ce33
commit 33733720c5

View File

@@ -164,14 +164,14 @@ export async function interpolateProfiles(actorIdsOrNames, context, options = {}
profile.avatar_media_id = actorProfiles
.map((actorProfile) => actorProfile.avatar)
.filter((avatar) => avatar && (avatar.entropy === null || avatar.entropy > 5.5))
.filter((avatar) => avatar && (avatar.entropy === null || avatar.entropy > 5.5) && !options.avoidAvatarCredits?.includes(avatar.credit) && !options.excludeAvatarCredits?.includes(avatar.credit))
.sort((avatarA, avatarB) => avatarB.height - avatarA.height)[0]?.id || null;
if (!profile.avatar_media_id) {
// try to settle for low quality avatar
profile.avatar_media_id = actorProfiles
.map((actorProfile) => actorProfile.avatar)
.filter((avatar) => avatar)
.filter((avatar) => !!avatar && !options?.excludeAvatarCredits?.includes(avatar.credit))
.sort((avatarA, avatarB) => avatarB.height - avatarA.height)[0]?.id || null;
}