Added profile interpolation.

This commit is contained in:
2020-05-17 03:00:44 +02:00
parent 05ee57378a
commit 985ab9d2dc
16 changed files with 252 additions and 35 deletions

View File

@@ -37,8 +37,11 @@ function curateActor(actor) {
};
if (actor.profiles && actor.profiles.length > 0) {
curatedActor.avatar = actor.profiles.slice(0, 1)[0].avatar;
curatedActor.photos = actor.profiles.slice(1).map(profile => profile.avatar);
const photos = actor.profiles
.map(profile => profile.avatar)
.filter(avatar => avatar && (!curatedActor.avatar || avatar.hash !== curatedActor.avatar.hash));
curatedActor.photos = Object.values(photos.reduce((acc, photo) => ({ ...acc, [photo.hash]: photo }), {}));
}
if (actor.releases) {
@@ -76,6 +79,7 @@ function initActorActions(store, _router) {
birthdate: dateOfBirth
age
ethnicity
cup
bust
waist
hip
@@ -96,6 +100,15 @@ function initActorActions(store, _router) {
name
slug
}
avatar: avatarMedia {
id
path
thumbnail
lazy
hash
comment
copyright
}
profiles: actorsProfiles {
description
avatar: avatarMedia {
@@ -103,6 +116,7 @@ function initActorActions(store, _router) {
path
thumbnail
lazy
hash
comment
copyright
}
@@ -226,6 +240,14 @@ function initActorActions(store, _router) {
name
slug
}
avatar: avatarMedia {
id
path
thumbnail
lazy
comment
copyright
}
actorsProfiles {
actorsAvatarByProfileId {
media {