Compare commits

...

2 Commits

Author SHA1 Message Date
074b5a4ae4 0.46.19 2026-03-01 05:08:54 +01:00
e1e83994e0 Don't fetch actor assets for scene and movie aggregations. 2026-03-01 05:08:51 +01:00
5 changed files with 16 additions and 13 deletions

4
package-lock.json generated
View File

@@ -1,11 +1,11 @@
{
"name": "traxxx-web",
"version": "0.46.18",
"version": "0.46.19",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"version": "0.46.18",
"version": "0.46.19",
"dependencies": {
"@brillout/json-serializer": "^0.5.8",
"@dicebear/collection": "^7.0.5",

View File

@@ -92,7 +92,7 @@
"overrides": {
"vite": "$vite"
},
"version": "0.46.18",
"version": "0.46.19",
"imports": {
"#/*": "./*.js"
}

View File

@@ -271,12 +271,15 @@ export async function fetchActorsById(actorIds, options = {}, reqUser) {
.where('user_id', reqUser.id)
.whereIn('actor_id', actorIds)
: [],
]);
].slice(0, options.shallow ? 1 : -1));
if (options.order) {
return actors.map((actorEntry) => curateActor(actorEntry, {
stashes: stashes.filter((stash) => stash.actor_id === actorEntry.id),
alerts: alerts.filter((alert) => alert.actor_id === actorEntry.id),
stashes: stashes?.filter((stash) => stash.actor_id === actorEntry.id),
alerts: alerts?.filter((alert) => alert.actor_id === actorEntry.id),
profiles: profiles?.filter((profile) => profile.actor_id === actorEntry.id),
photos: photos?.filter((photo) => photo.actor_id === actorEntry.id),
socials: socials?.filter((social) => social.actor_id === actorEntry.id),
append: options.append,
}));
}
@@ -290,11 +293,11 @@ export async function fetchActorsById(actorIds, options = {}, reqUser) {
}
return curateActor(actor, {
stashes: stashes.filter((stash) => stash.actor_id === actor.id),
alerts: alerts.filter((alert) => alert.actor_id === actor.id),
profiles: profiles.filter((profile) => profile.actor_id === actor.id),
photos: photos.filter((photo) => photo.actor_id === actor.id),
socials: socials.filter((social) => social.actor_id === actor.id),
stashes: stashes?.filter((stash) => stash.actor_id === actor.id),
alerts: alerts?.filter((alert) => alert.actor_id === actor.id),
profiles: profiles?.filter((profile) => profile.actor_id === actor.id),
photos: photos?.filter((photo) => photo.actor_id === actor.id),
socials: socials?.filter((social) => social.actor_id === actor.id),
append: options.append,
});
}).filter(Boolean);

View File

@@ -421,7 +421,7 @@ export async function fetchMovies(filters, rawOptions, reqUser, context) {
const channelCounts = options.aggregateChannels && countAggregations(result.aggregations?.channelIds);
const [aggActors, aggTags, aggChannels] = await Promise.all([
options.aggregateActors ? fetchActorsById(result.aggregations.actorIds.map((bucket) => bucket.key), { order: ['slug', 'asc'], append: actorCounts }, reqUser) : [],
options.aggregateActors ? fetchActorsById(result.aggregations.actorIds.map((bucket) => bucket.key), { shadllow: true, order: ['slug', 'asc'], append: actorCounts }, reqUser) : [],
options.aggregateTags ? fetchTagsById(result.aggregations.tagIds.map((bucket) => bucket.key), { order: [knex.raw('lower(name)'), 'asc'], append: tagCounts }, reqUser, context) : [],
options.aggregateChannels ? fetchEntitiesById(result.aggregations.channelIds.map((bucket) => bucket.key), { order: ['slug', 'asc'], append: channelCounts }, reqUser, context) : [],
]);

View File

@@ -649,7 +649,7 @@ export async function fetchScenes(filters, rawOptions, reqUser, context) {
console.time('fetch aggregations');
const [aggActors, aggTags, aggChannels] = await Promise.all([
options.aggregateActors ? fetchActorsById(result.aggregations.actorIds.map((bucket) => bucket.key), { order: ['slug', 'asc'], append: actorCounts }, reqUser) : [],
options.aggregateActors ? fetchActorsById(result.aggregations.actorIds.map((bucket) => bucket.key), { shallow: true, order: ['slug', 'asc'], append: actorCounts }, reqUser) : [],
options.aggregateTags ? fetchTagsById(result.aggregations.tagIds.map((bucket) => bucket.key), { order: [knex.raw('lower(name)'), 'asc'], append: tagCounts }, reqUser, context) : [],
options.aggregateChannels ? fetchEntitiesById(entityIds.map((bucket) => bucket.key), { order: ['slug', 'asc'], append: channelCounts }, reqUser, context) : [],
]);