Added m3u8 stream support to media module. Added Elegant Angel. Added regex parameter to qu's number method. Various tags.
This commit is contained in:
@@ -134,7 +134,7 @@ function toBaseActors(actorsOrNames, release) {
|
||||
});
|
||||
}
|
||||
|
||||
function curateActor(actor, withDetails = false) {
|
||||
function curateActor(actor, withDetails = false, isProfile = false) {
|
||||
if (!actor) {
|
||||
return null;
|
||||
}
|
||||
@@ -174,7 +174,7 @@ function curateActor(actor, withDetails = false) {
|
||||
hasPiercings: actor.has_piercings,
|
||||
tattoos: actor.tattoos,
|
||||
piercings: actor.piercings,
|
||||
description: actor.description,
|
||||
...(isProfile && { description: actor.description }),
|
||||
placeOfBirth: actor.birth_country && {
|
||||
country: {
|
||||
alpha2: actor.birth_country.alpha2,
|
||||
@@ -201,6 +201,7 @@ function curateActor(actor, withDetails = false) {
|
||||
size: actor.avatar.size,
|
||||
source: actor.avatar.source,
|
||||
},
|
||||
...(actor.profiles && { profiles: actor.profiles?.map(profile => curateActor(profile, true, true)) }),
|
||||
}),
|
||||
};
|
||||
|
||||
@@ -504,12 +505,14 @@ async function scrapeProfiles(actor, sources, entitiesBySlug, existingProfilesBy
|
||||
return await [].concat(source).reduce(async (outcome, scraperSlug) => outcome.catch(async () => {
|
||||
try {
|
||||
const scraper = scrapers[scraperSlug];
|
||||
const entity = entitiesBySlug[scraperSlug] || null;
|
||||
|
||||
const context = {
|
||||
...entitiesBySlug[scraperSlug],
|
||||
...entity,
|
||||
// legacy
|
||||
site: entitiesBySlug[scraperSlug] || null,
|
||||
network: entitiesBySlug[scraperSlug] || null,
|
||||
entity: entitiesBySlug[scraperSlug] || null,
|
||||
site: entity,
|
||||
network: entity?.parent,
|
||||
entity,
|
||||
scraper: scraperSlug,
|
||||
};
|
||||
|
||||
@@ -547,7 +550,7 @@ async function scrapeProfiles(actor, sources, entitiesBySlug, existingProfilesBy
|
||||
return await curateProfile({
|
||||
...actor,
|
||||
...profile,
|
||||
...context,
|
||||
entity,
|
||||
update: existingProfile?.id || false,
|
||||
});
|
||||
} catch (error) {
|
||||
@@ -715,7 +718,8 @@ async function fetchActor(actorId) {
|
||||
row_to_json(actor_alias) as alias,
|
||||
row_to_json(birth_country) as birth_country,
|
||||
row_to_json(residence_country) as residence_country,
|
||||
row_to_json(media) as avatar
|
||||
row_to_json(media) as avatar,
|
||||
json_agg(actors_profiles) as profiles
|
||||
`))
|
||||
.modify((queryBuilder) => {
|
||||
if (Number.isNaN(Number(actorId))) {
|
||||
@@ -726,10 +730,12 @@ async function fetchActor(actorId) {
|
||||
queryBuilder.where('actors.id', actorId);
|
||||
})
|
||||
.leftJoin('actors as actor_alias', 'actor_alias.id', 'actors.alias_for')
|
||||
.leftJoin('actors_profiles', 'actors.id', 'actors_profiles.actor_id')
|
||||
.leftJoin('entities', 'entities.id', 'actors.entity_id')
|
||||
.leftJoin('countries as birth_country', 'birth_country.alpha2', 'actors.birth_country_alpha2')
|
||||
.leftJoin('countries as residence_country', 'residence_country.alpha2', 'actors.residence_country_alpha2')
|
||||
.leftJoin('media', 'media.id', 'actors.avatar_media_id')
|
||||
.groupBy('actors.id', 'entities.id', 'actor_alias.id', 'birth_country.alpha2', 'residence_country.alpha2', 'media.id')
|
||||
.first();
|
||||
|
||||
return curateActor(actor, true);
|
||||
|
||||
Reference in New Issue
Block a user