Compare commits

..

No commits in common. "8641651a55261aba232449c90f9b7a584bdb948d" and "16a5d92efe1370340ca18d1eb3ce788e34e30a91" have entirely different histories.

4 changed files with 12 additions and 13 deletions

View File

@ -1001,8 +1001,7 @@ exports.up = knex => Promise.resolve()
// allow vim fold // allow vim fold
return knex.raw(` return knex.raw(`
/* We need both the release entries and their search ranking, and PostGraphile does not seem to allow virtual foreign keys on function results. /* We need both the release entries and their search ranking, and PostGraphile does not seem to allow virtual foreign keys on function results.
* Using a view as a proxy for the search results allows us to get both a reference to the releases table, and the ranking. * Using a view as a proxy for the search results allows us to get both a reference to the releases table, and the ranking */
* A composite type does not seem to be compatible with PostGraphile's @sortable. */
CREATE VIEW releases_search_results AS CREATE VIEW releases_search_results AS
SELECT NULL::integer as id, NULL::real as rank; SELECT NULL::integer as id, NULL::real as rank;

4
package-lock.json generated
View File

@ -1,11 +1,11 @@
{ {
"name": "traxxx", "name": "traxxx",
"version": "1.175.2", "version": "1.175.1",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"version": "1.175.2", "version": "1.175.1",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"@graphile-contrib/pg-order-by-related": "^1.0.0-beta.6", "@graphile-contrib/pg-order-by-related": "^1.0.0-beta.6",

View File

@ -1,6 +1,6 @@
{ {
"name": "traxxx", "name": "traxxx",
"version": "1.175.2", "version": "1.175.1",
"description": "All the latest porn releases in one place", "description": "All the latest porn releases in one place",
"main": "src/app.js", "main": "src/app.js",
"scripts": { "scripts": {

View File

@ -83,7 +83,7 @@ async function scrapeScene(scene, entity, options) {
release.poster = getScreenUrl(poster, scene); release.poster = getScreenUrl(poster, scene);
release.photos = remainingScreens.map(photo => getScreenUrl(photo, scene)); release.photos = remainingScreens.map(photo => getScreenUrl(photo, scene));
if (options?.includePhotos) { if (options.includePhotos) {
const photos = await fetchPhotos(scene); const photos = await fetchPhotos(scene);
if (photos?.length > 0) { if (photos?.length > 0) {
@ -100,11 +100,11 @@ async function scrapeScene(scene, entity, options) {
return release; return release;
} }
function scrapeAll(scenes, entity) { function scrapeAll(scenes) {
return scenes.map(({ _source: scene }) => scrapeScene(scene, entity)); return scenes.map(({ _source: scene }) => scrapeScene(scene));
} }
async function fetchActorReleases(actor, entity) { async function fetchActorReleases(actor) {
const res = await http.post(`https://${clusterId}.us-east-1.aws.found.io/videos/video/_search`, { const res = await http.post(`https://${clusterId}.us-east-1.aws.found.io/videos/video/_search`, {
size: 50, size: 50,
query: { query: {
@ -158,10 +158,10 @@ async function fetchActorReleases(actor, entity) {
}, },
}); });
return scrapeAll(res.body.hits.hits, entity); return scrapeAll(res.body.hits.hits);
} }
async function scrapeProfile(actor, entity, include) { async function scrapeProfile(actor, include) {
const profile = {}; const profile = {};
profile.aliases = actor.aliases; profile.aliases = actor.aliases;
@ -193,7 +193,7 @@ async function scrapeProfile(actor, entity, include) {
if (actor.image) profile.avatar = `https://i.bang.com/pornstars/${actor.identifier}.jpg`; if (actor.image) profile.avatar = `https://i.bang.com/pornstars/${actor.identifier}.jpg`;
if (include.releases) { if (include.releases) {
profile.releases = await fetchActorReleases(actor, entity); profile.releases = await fetchActorReleases(actor);
} }
return profile; return profile;
@ -402,7 +402,7 @@ async function fetchProfile({ name: actorName }, context, include) {
const actor = res.body.hits.hits.find(hit => hit._source.name.toLowerCase() === actorName.toLowerCase()); const actor = res.body.hits.hits.find(hit => hit._source.name.toLowerCase() === actorName.toLowerCase());
if (actor) { if (actor) {
return scrapeProfile(actor._source, context.entity, include); return scrapeProfile(actor._source, include);
} }
return null; return null;