Compare commits

..

No commits in common. "a51a1598869d8c370d99c1d48a8ff05e24d6b3e8" and "71e76e359aa0445fae2a2a66939ae32e1924b5db" have entirely different histories.

5 changed files with 5 additions and 24 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "traxxx",
"version": "1.150.0",
"version": "1.149.9",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

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

View File

@ -436,17 +436,10 @@ async function curateProfile(profile, actor) {
}
}
async function interpolateProfiles(actorIdsOrNames) {
async function interpolateProfiles(actorIds) {
const profiles = await knex('actors_profiles')
.select('actors_profiles.*', knex.raw('row_to_json(media) as avatar'))
.leftJoin('actors', 'actors.id', 'actors_profiles.actor_id')
.modify((query) => {
if (actorIdsOrNames?.length > 0) {
query
.whereIn('actor_id', actorIdsOrNames.filter(idOrName => typeof idOrName === 'number'))
.orWhereIn('actors.name', actorIdsOrNames.filter(idOrName => typeof idOrName === 'string'));
}
})
.whereIn('actor_id', actorIds)
.leftJoin('media', 'actors_profiles.avatar_media_id', 'media.id');
const profilesByActorId = profiles.reduce((acc, profile) => ({
@ -457,8 +450,6 @@ async function interpolateProfiles(actorIdsOrNames) {
],
}), {});
logger.info(`Interpolating ${profiles.length} profiles from ${Object.keys(profilesByActorId).length} actors`);
const interpolatedProfiles = Object.entries(profilesByActorId).map(([actorId, actorProfiles]) => {
// group values from each profile
const valuesByProperty = actorProfiles.reduce((acc, profile) => Object
@ -908,5 +899,4 @@ module.exports = {
scrapeActors,
searchActors,
toBaseActors,
interpolateProfiles,
};

View File

@ -9,7 +9,7 @@ const knex = require('./knex');
const fetchUpdates = require('./updates');
const { fetchScenes, fetchMovies } = require('./deep');
const { storeScenes, storeMovies, updateReleasesSearch } = require('./store-releases');
const { scrapeActors, interpolateProfiles } = require('./actors');
const { scrapeActors } = require('./actors');
const { flushEntities } = require('./entities');
const { deleteScenes, deleteMovies, flushBatches } = require('./releases');
const { flushOrphanedMedia } = require('./media');
@ -25,10 +25,6 @@ async function init() {
await updateReleasesSearch();
}
if (argv.interpolateProfiles) {
await interpolateProfiles(argv.interpolateProfiles);
}
if (argv.flushNetworks || argv.flushChannels) {
await flushEntities(argv.flushNetworks, argv.flushChannels);
}

View File

@ -248,11 +248,6 @@ const { argv } = yargs
type: 'boolean',
default: false,
})
.option('interpolate-profiles', {
describe: 'Interpolate actor profiles',
type: 'array',
alias: 'interpolate',
})
.option('flush-orphaned-media', {
describe: 'Remove all orphaned media items from database and disk.',
type: 'array',