Compare commits

...

2 Commits

4 changed files with 15 additions and 7 deletions

View File

@@ -97,7 +97,7 @@ const submitted = ref(false);
async function searchActors() { async function searchActors() {
const res = await get('/actors', { const res = await get('/actors', {
q: `${actorQuery.value}*`, // return partial matches q: actorQuery.value.charAt(0) === '#' ? actorQuery.value : `${actorQuery.value}*`, // return partial matches
limit: 10, limit: 10,
global: true, global: true,
}); });

4
package-lock.json generated
View File

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

View File

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

View File

@@ -260,14 +260,17 @@ export async function fetchActorsById(actorIds, options = {}, reqUser) {
knex('actors_avatars') knex('actors_avatars')
.select( .select(
'media.*', 'media.*',
'actors_avatars.actor_id', // 'actors_avatars.actor_id',
'actors_profiles.actor_id',
knex.raw('json_agg(actors_avatars.profile_id) as profile_ids'), knex.raw('json_agg(actors_avatars.profile_id) as profile_ids'),
knex.raw('row_to_json(sfw_media) as sfw_media'), knex.raw('row_to_json(sfw_media) as sfw_media'),
) )
.whereIn('actor_id', actorIds) .whereIn('actors_profiles.actor_id', actorIds)
.leftJoin('media', 'media.id', 'actors_avatars.media_id') .leftJoin('media', 'media.id', 'actors_avatars.media_id')
.leftJoin('media as sfw_media', 'sfw_media.id', 'media.sfw_media_id') .leftJoin('media as sfw_media', 'sfw_media.id', 'media.sfw_media_id')
.groupBy('media.id', 'sfw_media.id', 'actors_avatars.actor_id') .leftJoin('actors_profiles', 'actors_profiles.id', 'actors_avatars.profile_id')
// .groupBy('media.id', 'sfw_media.id', 'actors_avatars.actor_id')
.groupBy('media.id', 'sfw_media.id', 'actors_profiles.actor_id')
.orderBy(knex.raw('max(actors_avatars.created_at)'), 'desc'), .orderBy(knex.raw('max(actors_avatars.created_at)'), 'desc'),
knex('actors_socials') knex('actors_socials')
.whereIn('actor_id', actorIds), .whereIn('actor_id', actorIds),
@@ -603,6 +606,11 @@ export async function mergeActors(targetActorId, sourceActorId, reqUser) {
.where('actor_id', sourceActorId) .where('actor_id', sourceActorId)
.returning('id'); .returning('id');
// some avatars are not matched to a profile, need to investigate why this happens and the avatar table needs a dedicated actor field
await trx('actors_avatars')
.update('actor_id', targetActorId)
.where('actor_id', sourceActorId);
mergedScenes = await trx('releases_actors') mergedScenes = await trx('releases_actors')
.update({ .update({
actor_id: targetActorId, actor_id: targetActorId,