Added materialized view for SFW media in hopes of improving media insert performance.

This commit is contained in:
DebaucheryLibrarian
2026-02-08 04:56:14 +01:00
parent a77ce63548
commit 371e97f695
3 changed files with 43 additions and 4 deletions

View File

@@ -204,6 +204,13 @@ async function fetchProfileApi(actor, { entity, parameters }) {
return null;
}
function getBioXPath(field) {
return [
`//span[text()="${field}"]/following-sibling::span`,
`//span[text()="${field}"]/following-sibling::text()`,
];
}
function scrapeProfile({ query }, url) {
const profile = { url };
const avatar = query.img('div[class*="prof-pic"] > img');
@@ -216,11 +223,13 @@ function scrapeProfile({ query }, url) {
}
profile.description = query.content('h2') || null;
profile.height = query.number('//span[text()="Height"]/following-sibling::node()[self::span or self::text()]', { match: /(\d+) cm/, matchIndex: 1 });
profile.weight = query.number('//span[text()="Weight"]/following-sibling::node()[self::span or self::text()]', { match: /(\d+) kg/, matchIndex: 1 });
profile.measurements = query.content('//span[text()="Measurements"]/following-sibling::node()[self::span or self::text()]');
profile.birthPlace = query.content('//span[text()="Birth Place"]/following-sibling::node()[self::span or self::text()]');
// ::node()[self::span or self::text()] not supported by unprint/JSDOM
profile.height = query.number(getBioXPath('Height'), { match: /(\d+) cm/, matchIndex: 1 }) || null;
profile.weight = query.number(getBioXPath('Weight'), { match: /(\d+) kg/, matchIndex: 1 }) || null;
profile.measurements = query.content(getBioXPath('Measurements')) || null;
profile.birthPlace = query.content(getBioXPath('Birth Place')) || null;
profile.banner = query.img('div[class*="banner"] > img');
profile.photos = query.imgs('#MusModelSwiper img');