Drastic actor page redesign. Storing one avatar per actor, other profile photos as 'photo' role; no longer assuming first photo is avatar.
This commit is contained in:
@@ -239,6 +239,8 @@ async function storeAvatars(profile, actor) {
|
||||
return !existingAvatars.some(avatar => file.hash === avatar.hash);
|
||||
});
|
||||
|
||||
const hasAvatar = existingAvatars.some(avatar => avatar.role === 'avatar');
|
||||
|
||||
await knex('media')
|
||||
.insert(newAvatars.map((file, index) => ({
|
||||
path: file.filepath,
|
||||
@@ -249,7 +251,7 @@ async function storeAvatars(profile, actor) {
|
||||
index,
|
||||
domain: 'actors',
|
||||
target_id: actor.id,
|
||||
role: 'avatar',
|
||||
role: index === 0 && !hasAvatar ? 'avatar' : 'photo',
|
||||
})));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user