Rounding actor profile values stored as integers to prevent database errors.
This commit is contained in:
@@ -440,35 +440,35 @@ async function curateProfile(profile, actor) {
|
|||||||
|| null;
|
|| null;
|
||||||
|
|
||||||
curatedProfile.dateOfDeath = Number.isNaN(Number(profile.dateOfDeath)) ? null : profile.dateOfDeath;
|
curatedProfile.dateOfDeath = Number.isNaN(Number(profile.dateOfDeath)) ? null : profile.dateOfDeath;
|
||||||
curatedProfile.age = Number(profile.age) || null;
|
curatedProfile.age = Math.round(profile.age) || null;
|
||||||
|
|
||||||
curatedProfile.height = Number(profile.height) || profile.height?.match?.(/\d+/)?.[0] || null;
|
curatedProfile.height = Math.round(profile.height || profile.height?.match?.(/\d+/)?.[0]) || null;
|
||||||
curatedProfile.weight = Number(profile.weight) || profile.weight?.match?.(/\d+/)?.[0] || null;
|
curatedProfile.weight = Math.round(profile.weight || profile.weight?.match?.(/\d+/)?.[0]) || null;
|
||||||
curatedProfile.shoeSize = Number(profile.shoeSize) || profile.shoeSize?.match?.(/\d+/)?.[0] || null;
|
|
||||||
|
|
||||||
// separate measurement values
|
// separate measurement values
|
||||||
curatedProfile.cup = profile.cup || (typeof profile.bust === 'string' && profile.bust?.match?.(/[a-zA-Z]+/)?.[0]) || null;
|
curatedProfile.cup = profile.cup || (typeof profile.bust === 'string' && profile.bust?.match?.(/[a-zA-Z]+/)?.[0]) || null;
|
||||||
curatedProfile.bust = Number(profile.bust) || profile.bust?.match?.(/\d+/)?.[0] || null;
|
curatedProfile.bust = Math.round(profile.bust || profile.bust?.match?.(/\d+/)?.[0]) || null;
|
||||||
curatedProfile.waist = Number(profile.waist) || profile.waist?.match?.(/\d+/)?.[0] || null;
|
curatedProfile.waist = Math.round(profile.waist || profile.waist?.match?.(/\d+/)?.[0]) || null;
|
||||||
curatedProfile.hip = Number(profile.hip) || profile.hip?.match?.(/\d+/)?.[0] || null;
|
curatedProfile.hip = Math.round(profile.hip || profile.hip?.match?.(/\d+/)?.[0]) || null;
|
||||||
|
|
||||||
curatedProfile.leg = Number(profile.leg) || profile.leg?.match?.(/\d+/)?.[0] || null;
|
curatedProfile.leg = Math.round(profile.leg || profile.leg?.match?.(/\d+/)?.[0]) || null;
|
||||||
curatedProfile.thigh = Number(profile.thigh) || profile.thigh?.match?.(/\d+/)?.[0] || null;
|
curatedProfile.thigh = Math.round(profile.thigh || profile.thigh?.match?.(/\d+/)?.[0]) || null;
|
||||||
curatedProfile.foot = Number(profile.foot) || profile.foot?.match?.(/\d+/)?.[0] || null;
|
curatedProfile.foot = Number(profile.foot || profile.foot?.match?.(/\d+/)?.[0]) || null;
|
||||||
|
curatedProfile.shoeSize = Number(profile.shoeSize || profile.shoeSize?.match?.(/\d+/)?.[0]) || null;
|
||||||
|
|
||||||
// combined measurement value
|
// combined measurement value
|
||||||
// ExCoGi uses x, Jules Jordan has spaces between the dashes, SpermMenia/Cum Buffet sometimes misses cup
|
// ExCoGi uses x, Jules Jordan has spaces between the dashes, SpermMenia/Cum Buffet sometimes misses cup
|
||||||
const measurements = profile.measurements?.match(/(\d+)([a-z]+)?(?:\s*[-x]\s*(\d+)\s*[-x]\s*(\d+))?/i);
|
const measurements = profile.measurements?.match(/(\d+)([a-z]+)?(?:\s*[-x]\s*(\d+)\s*[-x]\s*(\d+))?/i);
|
||||||
|
|
||||||
if (measurements) {
|
if (measurements) {
|
||||||
curatedProfile.bust = Number(measurements[1]) || null;
|
curatedProfile.bust = Math.round(measurements[1]) || null;
|
||||||
curatedProfile.cup = measurements[2] || null;
|
curatedProfile.cup = measurements[2] || null;
|
||||||
curatedProfile.waist = Number(measurements[3]) || null;
|
curatedProfile.waist = Math.round(measurements[3]) || null;
|
||||||
curatedProfile.hip = Number(measurements[4]) || null;
|
curatedProfile.hip = Math.round(measurements[4]) || null;
|
||||||
}
|
}
|
||||||
|
|
||||||
curatedProfile.penisLength = Number(profile.penisLength) || profile.penisLength?.match?.(/\d+/)?.[0] || null;
|
curatedProfile.penisLength = Math.round(profile.penisLength || profile.penisLength?.match?.(/\d+/)?.[0]) || null;
|
||||||
curatedProfile.penisGirth = Number(profile.penisGirth) || profile.penisGirth?.match?.(/\d+/)?.[0] || null;
|
curatedProfile.penisGirth = Math.round(profile.penisGirth || profile.penisGirth?.match?.(/\d+/)?.[0]) || null;
|
||||||
|
|
||||||
curatedProfile.isCircumcised = getBoolean(profile.isCircumcised);
|
curatedProfile.isCircumcised = getBoolean(profile.isCircumcised);
|
||||||
curatedProfile.naturalBoobs = getBoolean(profile.naturalBoobs);
|
curatedProfile.naturalBoobs = getBoolean(profile.naturalBoobs);
|
||||||
|
|||||||
Reference in New Issue
Block a user