Excluded location from In The Crack scene actor data.
This commit is contained in:
@@ -4,7 +4,7 @@ const unprint = require('unprint');
|
|||||||
|
|
||||||
const slugify = require('../utils/slugify');
|
const slugify = require('../utils/slugify');
|
||||||
|
|
||||||
function scrapeProfile(model, channel) {
|
function scrapeProfile(model, channel, isProfile = false) {
|
||||||
const profile = {};
|
const profile = {};
|
||||||
|
|
||||||
profile.name = model.name; // used by shallow scrape
|
profile.name = model.name; // used by shallow scrape
|
||||||
@@ -12,22 +12,6 @@ function scrapeProfile(model, channel) {
|
|||||||
|
|
||||||
profile.dateOfBirth = unprint.extractDate(model.birthdate, 'YYYY-MM-DD');
|
profile.dateOfBirth = unprint.extractDate(model.birthdate, 'YYYY-MM-DD');
|
||||||
|
|
||||||
profile.birthPlace = model.countries?.map((country) => {
|
|
||||||
if (country.name) {
|
|
||||||
return country.name;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (country.isO2 || country.iso2) { // sic
|
|
||||||
return country.isO2 || country.iso2;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (typeof country === 'string') {
|
|
||||||
return country;
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}).filter(Boolean)[0];
|
|
||||||
|
|
||||||
profile.height = model.height;
|
profile.height = model.height;
|
||||||
profile.weight = model.weight;
|
profile.weight = model.weight;
|
||||||
|
|
||||||
@@ -41,6 +25,25 @@ function scrapeProfile(model, channel) {
|
|||||||
profile.url = `${channel.origin}/modelcollections/${model.id}`;
|
profile.url = `${channel.origin}/modelcollections/${model.id}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isProfile) {
|
||||||
|
// exclude from scene actor data, as this will trigger a metric ton of untimely location lookups
|
||||||
|
profile.birthPlace = model.countries?.map((country) => {
|
||||||
|
if (country.name) {
|
||||||
|
return country.name;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (country.isO2 || country.iso2) { // sic
|
||||||
|
return country.isO2 || country.iso2;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof country === 'string') {
|
||||||
|
return country;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}).filter(Boolean)[0];
|
||||||
|
}
|
||||||
|
|
||||||
return profile;
|
return profile;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -235,7 +238,7 @@ async function fetchProfile(actor, channel) {
|
|||||||
const res = await unprint.get(`https://api.inthecrack.com/Model/${modelId}`);
|
const res = await unprint.get(`https://api.inthecrack.com/Model/${modelId}`);
|
||||||
|
|
||||||
if (res.ok) {
|
if (res.ok) {
|
||||||
return scrapeProfile(res.data, channel);
|
return scrapeProfile(res.data, channel, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
Reference in New Issue
Block a user