forked from DebaucheryLibrarian/traxxx
Fixed actor data and avatar fetching and display.
This commit is contained in:
parent
5a6bf2b42f
commit
e77dbca954
|
@ -9,7 +9,6 @@ import { curateRelease } from '../curate';
|
|||
function curateActor(actor) {
|
||||
const curatedActor = {
|
||||
...actor,
|
||||
avatar: actor.avatar.media,
|
||||
height: actor.heightMetric && {
|
||||
metric: actor.heightMetric,
|
||||
imperial: actor.heightImperial,
|
||||
|
@ -30,6 +29,10 @@ function curateActor(actor) {
|
|||
},
|
||||
};
|
||||
|
||||
if (actor.avatar) {
|
||||
curatedActor.avatar = actor.avatar.media;
|
||||
}
|
||||
|
||||
if (actor.releases) {
|
||||
curatedActor.releases = actor.releases.map(release => curateRelease(release.release));
|
||||
}
|
||||
|
@ -145,6 +148,8 @@ function initActorActions(store, _router) {
|
|||
id
|
||||
name
|
||||
slug
|
||||
age
|
||||
birthdate
|
||||
avatar: actorsAvatarByActorId {
|
||||
media {
|
||||
thumbnail
|
||||
|
|
|
@ -211,7 +211,9 @@ async function storePhotos(photos, {
|
|||
.first();
|
||||
|
||||
if (primaryPhoto) {
|
||||
await upsert(`${domain}s_${role}s`, photoAssociations, [`${domain}_id`, 'media_id']);
|
||||
const remainingAssociations = photoAssociations.filter(association => association.media_id === primaryPhoto.media_id);
|
||||
|
||||
await upsert(`${domain}s_${role}s`, remainingAssociations, [`${domain}_id`, 'media_id']);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -219,6 +221,8 @@ async function storePhotos(photos, {
|
|||
upsert(`${domain}s_${primaryRole}s`, photoAssociations.slice(0, 1), [`${domain}_id`, 'media_id']),
|
||||
upsert(`${domain}s_${role}s`, photoAssociations.slice(1), [`${domain}_id`, 'media_id']),
|
||||
]);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
await upsert(`${domain}s_${role}s`, photoAssociations, [`${domain}_id`, 'media_id']);
|
||||
|
|
|
@ -306,7 +306,6 @@ async function storeReleaseAssets(release, releaseId) {
|
|||
targetId: releaseId,
|
||||
subpath,
|
||||
}, identifier),
|
||||
/*
|
||||
storePhotos(release.covers, {
|
||||
role: 'cover',
|
||||
targetId: releaseId,
|
||||
|
@ -316,7 +315,6 @@ async function storeReleaseAssets(release, releaseId) {
|
|||
targetId: releaseId,
|
||||
subpath,
|
||||
}, identifier),
|
||||
*/
|
||||
]);
|
||||
} catch (error) {
|
||||
console.log(release.url, error);
|
||||
|
|
Loading…
Reference in New Issue