Added site filter to Gamma API actor fetch for more accurate profile results.
This commit is contained in:
@@ -100,7 +100,6 @@ module.exports = {
|
||||
'3rddegreefilms': gamma,
|
||||
addicted2girls: gamma,
|
||||
biphoria: gamma,
|
||||
blakemason: gamma,
|
||||
blowpass: gamma,
|
||||
burningangel: gamma,
|
||||
chaosmen: gamma,
|
||||
|
||||
@@ -927,18 +927,19 @@ async function fetchProfile({ name: actorName }, context, include, altSearchUrl,
|
||||
|
||||
async function fetchApiProfile({ name: actorName }, context, include) {
|
||||
const siteSlug = context.entity.slug || context.site?.slug || context.network?.slug;
|
||||
|
||||
const actorSlug = encodeURI(actorName);
|
||||
// const referer = `https://www.${siteSlug}.com/en/search`;
|
||||
const referer = `${new URL(context.entity.url).origin}/en/search`;
|
||||
const referer = `${context.entity.origin}/en/search`;
|
||||
|
||||
const { apiUrl } = await fetchApiCredentials(referer);
|
||||
|
||||
const availableOnSites = (context.parameters.actorAvailableOnSites || [siteSlug]).map((site) => `"availableOnSite:${site}"`).join(',');
|
||||
|
||||
const res = await http.post(apiUrl, {
|
||||
requests: [
|
||||
{
|
||||
indexName: 'all_actors',
|
||||
params: `query=${actorSlug}`,
|
||||
params: `query=${actorSlug}&facetFilters=[[${availableOnSites}]]`,
|
||||
// params: `query=${actorSlug}`,
|
||||
},
|
||||
],
|
||||
}, {
|
||||
|
||||
Reference in New Issue
Block a user