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) {
|
function curateActor(actor) {
|
||||||
const curatedActor = {
|
const curatedActor = {
|
||||||
...actor,
|
...actor,
|
||||||
avatar: actor.avatar.media,
|
|
||||||
height: actor.heightMetric && {
|
height: actor.heightMetric && {
|
||||||
metric: actor.heightMetric,
|
metric: actor.heightMetric,
|
||||||
imperial: actor.heightImperial,
|
imperial: actor.heightImperial,
|
||||||
|
@ -30,6 +29,10 @@ function curateActor(actor) {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (actor.avatar) {
|
||||||
|
curatedActor.avatar = actor.avatar.media;
|
||||||
|
}
|
||||||
|
|
||||||
if (actor.releases) {
|
if (actor.releases) {
|
||||||
curatedActor.releases = actor.releases.map(release => curateRelease(release.release));
|
curatedActor.releases = actor.releases.map(release => curateRelease(release.release));
|
||||||
}
|
}
|
||||||
|
@ -145,6 +148,8 @@ function initActorActions(store, _router) {
|
||||||
id
|
id
|
||||||
name
|
name
|
||||||
slug
|
slug
|
||||||
|
age
|
||||||
|
birthdate
|
||||||
avatar: actorsAvatarByActorId {
|
avatar: actorsAvatarByActorId {
|
||||||
media {
|
media {
|
||||||
thumbnail
|
thumbnail
|
||||||
|
|
|
@ -211,7 +211,9 @@ async function storePhotos(photos, {
|
||||||
.first();
|
.first();
|
||||||
|
|
||||||
if (primaryPhoto) {
|
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;
|
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_${primaryRole}s`, photoAssociations.slice(0, 1), [`${domain}_id`, 'media_id']),
|
||||||
upsert(`${domain}s_${role}s`, photoAssociations.slice(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']);
|
await upsert(`${domain}s_${role}s`, photoAssociations, [`${domain}_id`, 'media_id']);
|
||||||
|
|
|
@ -306,7 +306,6 @@ async function storeReleaseAssets(release, releaseId) {
|
||||||
targetId: releaseId,
|
targetId: releaseId,
|
||||||
subpath,
|
subpath,
|
||||||
}, identifier),
|
}, identifier),
|
||||||
/*
|
|
||||||
storePhotos(release.covers, {
|
storePhotos(release.covers, {
|
||||||
role: 'cover',
|
role: 'cover',
|
||||||
targetId: releaseId,
|
targetId: releaseId,
|
||||||
|
@ -316,7 +315,6 @@ async function storeReleaseAssets(release, releaseId) {
|
||||||
targetId: releaseId,
|
targetId: releaseId,
|
||||||
subpath,
|
subpath,
|
||||||
}, identifier),
|
}, identifier),
|
||||||
*/
|
|
||||||
]);
|
]);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(release.url, error);
|
console.log(release.url, error);
|
||||||
|
|
Loading…
Reference in New Issue