Enforcing profile ID in actors_avatars.
This commit is contained in:
@@ -611,8 +611,15 @@ async function upsertProfiles(profiles) {
|
||||
media_id: profile.avatarMediaId,
|
||||
}));
|
||||
|
||||
if (avatars.length > 0) {
|
||||
await batchInsert('actors_avatars', avatars, { conflict: false });
|
||||
const resolvedAvatars = avatars.filter((avatar) => !!avatar.profile_id);
|
||||
const unresolvedAvatars = avatars.filter((avatar) => !avatar.profile_id);
|
||||
|
||||
unresolvedAvatars.forEach((avatar) => {
|
||||
logger.warn(`Skipping avatar for actor ${avatar.actor_id} (${avatar.media_id}), no profile could be resolved`);
|
||||
});
|
||||
|
||||
if (resolvedAvatars.length > 0) {
|
||||
await batchInsert('actors_avatars', resolvedAvatars, { conflict: false });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user