Fixed avatars without entropy being discarded.

This commit is contained in:
DebaucheryLibrarian
2021-01-22 15:40:49 +01:00
parent 130368ca70
commit bd9b795516
2 changed files with 6 additions and 4 deletions

View File

@@ -548,7 +548,7 @@ async function interpolateProfiles(actorIdsOrNames) {
profile.avatar_media_id = actorProfiles
.map(actorProfile => actorProfile.avatar)
.filter(avatar => avatar && avatar.entropy > 6)
.filter(avatar => avatar && (avatar.entropy === null || avatar.entropy > 6))
.sort((avatarA, avatarB) => avatarB.height - avatarA.height)[0]?.id || null;
return profile;
@@ -683,6 +683,8 @@ async function scrapeProfiles(actor, sources, entitiesBySlug, existingProfilesBy
}
}), Promise.reject(new Error()));
} catch (error) {
console.log(error);
if (error.code !== 'PROFILE_NOT_AVAILABLE') {
logger.error(`Failed to fetch profile for '${actor.name}': ${error.message}`);
}