Added profile scraper tests (WIP), fixed some profile scrapers. Fixed slugify not breaking existing slugs.
This commit is contained in:
@@ -411,19 +411,16 @@ async function fetchScene(url, channel, baseRelease, options) {
|
||||
return res.status;
|
||||
}
|
||||
|
||||
async function scrapeProfile(data, channel) {
|
||||
async function scrapeProfile(data, _channel) {
|
||||
const model = data.model;
|
||||
const profile = {};
|
||||
|
||||
// most details seemingly unavailable in graphql
|
||||
if (profile.dateOfBirth) profile.birthdate = new Date(model.dateOfBirth);
|
||||
profile.gender = genderMap[model.sex];
|
||||
|
||||
profile.hair = model.hairColour;
|
||||
profile.nationality = model.nationality;
|
||||
|
||||
if (model.biography.trim().length > 0) profile.description = model.biography;
|
||||
|
||||
// most details seemingly unavailable in graphql
|
||||
if (profile.dateOfBirth) profile.birthdate = new Date(model.dateOfBirth);
|
||||
if (model.cupSize && model.bustMeasurment) profile.bust = `${model.bustMeasurment}${model.cupSize}`;
|
||||
if (model.waistMeasurment) profile.waist = model.waistMeasurment;
|
||||
if (model.hipMeasurment) profile.hip = model.hipMeasurment;
|
||||
@@ -432,9 +429,11 @@ async function scrapeProfile(data, channel) {
|
||||
profile.poster = getAvatarFallbacks(model.images.profile);
|
||||
profile.banner = getAvatarFallbacks(model.images.poster);
|
||||
|
||||
/*
|
||||
if (model.videos) {
|
||||
profile.scenes = scrapeAll(model.videos.edges.map((edge) => edge.node), channel);
|
||||
}
|
||||
*/
|
||||
|
||||
return profile;
|
||||
}
|
||||
@@ -558,6 +557,7 @@ async function fetchProfile(actor, { channel }) {
|
||||
) {
|
||||
model: findOneModel(input: { slug: $slug, site: $site }) {
|
||||
name
|
||||
sex
|
||||
biography
|
||||
images {
|
||||
listing {
|
||||
|
||||
Reference in New Issue
Block a user