diff --git a/actors.mjs b/actors.mjs index 493509f..945c26f 100644 --- a/actors.mjs +++ b/actors.mjs @@ -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; }