Added avatars to Gamma latest API.

This commit is contained in:
DebaucheryLibrarian 2020-09-10 03:56:09 +02:00
parent 89cb4f4770
commit 5ee5b270ef
1 changed files with 11 additions and 1 deletions

View File

@ -125,9 +125,19 @@ async function scrapeApiReleases(json, site) {
else if (site.url && site.parameters?.scene !== false) release.url = `${site.url}/en/video${release.path}`; else if (site.url && site.parameters?.scene !== false) release.url = `${site.url}/en/video${release.path}`;
release.date = moment.utc(scene.release_date, 'YYYY-MM-DD').toDate(); release.date = moment.utc(scene.release_date, 'YYYY-MM-DD').toDate();
release.actors = scene.actors.map(actor => ({ name: actor.name, gender: actor.gender }));
release.director = scene.directors[0]?.name || null; release.director = scene.directors[0]?.name || null;
release.actors = scene.actors.map(actor => ({
entryId: actor.actor_id,
name: actor.name,
gender: actor.gender,
avatar: [
`https://images03-openlife.gammacdn.com/actors/${actor.actor_id}/${actor.actor_id}_500x750.jpg`,
`https://images03-openlife.gammacdn.com/actors/${actor.actor_id}/${actor.actor_id}_240x360.jpg`,
`https://images03-openlife.gammacdn.com/actors/${actor.actor_id}/${actor.actor_id}_200x300.jpg`,
],
}));
release.tags = scene.master_categories release.tags = scene.master_categories
.concat(scene.categories?.map(category => category.name)) .concat(scene.categories?.map(category => category.name))
.filter(Boolean); // some categories don't have a name .filter(Boolean); // some categories don't have a name