forked from DebaucheryLibrarian/traxxx
Showing avatar on release actor tile. Fixed social URL validation.
This commit is contained in:
parent
61965d480c
commit
af5543190a
|
@ -8,8 +8,6 @@ function curateActor(actor, release) {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
if (actor.avatar) curatedActor.avatar = actor.avatar.media;
|
|
||||||
|
|
||||||
if (release && release.date && curatedActor.birthdate) {
|
if (release && release.date && curatedActor.birthdate) {
|
||||||
curatedActor.ageThen = dayjs(release.date).diff(actor.birthdate, 'year');
|
curatedActor.ageThen = dayjs(release.date).diff(actor.birthdate, 'year');
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,6 +37,12 @@ const actorFields = `
|
||||||
birthdate: dateOfBirth
|
birthdate: dateOfBirth
|
||||||
age
|
age
|
||||||
gender
|
gender
|
||||||
|
avatar: avatarMedia {
|
||||||
|
id
|
||||||
|
path
|
||||||
|
thumbnail
|
||||||
|
lazy
|
||||||
|
}
|
||||||
network {
|
network {
|
||||||
id
|
id
|
||||||
name
|
name
|
||||||
|
@ -47,15 +53,6 @@ const actorFields = `
|
||||||
name
|
name
|
||||||
alias
|
alias
|
||||||
}
|
}
|
||||||
actorsProfiles {
|
|
||||||
actorsAvatarByProfileId {
|
|
||||||
media {
|
|
||||||
path
|
|
||||||
thumbnail
|
|
||||||
copyright
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const releaseActorsFragment = `
|
const releaseActorsFragment = `
|
||||||
|
|
|
@ -196,7 +196,7 @@ async function curateProfile(profile) {
|
||||||
curatedProfile.social = Array.isArray(profile.social)
|
curatedProfile.social = Array.isArray(profile.social)
|
||||||
? profile.social.map((social) => {
|
? profile.social.map((social) => {
|
||||||
try {
|
try {
|
||||||
const { href } = new URL();
|
const { href } = new URL(social);
|
||||||
return href;
|
return href;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.warn(`Profile scraper for '${profile.site.name}' returned invalid social link: ${social}`);
|
logger.warn(`Profile scraper for '${profile.site.name}' returned invalid social link: ${social}`);
|
||||||
|
|
Loading…
Reference in New Issue