Fixed merge ignoring assigned scene tags.
This commit is contained in:
@@ -604,7 +604,9 @@ const tags = Array.from(scene.tags
|
||||
if (accTag && tag.actorId) {
|
||||
return acc.set(tag.id, {
|
||||
...tag,
|
||||
actors: [...accTag.actors, actorsById[tag.actorId]].toSorted((actorA, actorB) => actorA.name.localeCompare(actorB.name)),
|
||||
actors: [...accTag.actors, actorsById[tag.actorId]]
|
||||
.filter(Boolean) // shouldn't happen, but in case the tag actor isn't a scene actor
|
||||
.toSorted((actorA, actorB) => actorA.name.localeCompare(actorB.name)),
|
||||
});
|
||||
}
|
||||
|
||||
@@ -616,7 +618,7 @@ const tags = Array.from(scene.tags
|
||||
if (tag.actorId) {
|
||||
return acc.set(tag.id, {
|
||||
...tag,
|
||||
actors: [actorsById[tag.actorId]],
|
||||
actors: [actorsById[tag.actorId]].filter(Boolean),
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -693,6 +693,10 @@ export async function mergeActors(targetActorId, sourceActorIds, reqUser) {
|
||||
.whereIn('actor_id', sourceActorIds)
|
||||
.returning('release_id');
|
||||
|
||||
await trx('releases_tags')
|
||||
.update('actor_id', targetActorId)
|
||||
.whereIn('actor_id', sourceActorIds);
|
||||
|
||||
const [targetActorStashes, sourceActorStashes] = await Promise.all([
|
||||
trx('stashes_actors')
|
||||
.where('actor_id', targetActorId),
|
||||
|
||||
@@ -228,7 +228,7 @@ export async function fetchScenesById(sceneIds, { reqUser, ...context } = {}) {
|
||||
.whereIn('release_id', sceneIds)
|
||||
.leftJoin('actors as directors', 'directors.id', 'releases_directors.director_id'),
|
||||
tags: knex('releases_tags')
|
||||
.select('tags.id', 'slug', 'name', 'priority', 'release_id', 'actor_id')
|
||||
.select('tags.id', 'tags.slug', 'tags.name', 'tags.priority', 'releases_tags.release_id', 'actor_id')
|
||||
.leftJoin('tags', 'tags.id', 'releases_tags.tag_id')
|
||||
.whereNotNull('tags.id')
|
||||
.whereIn('release_id', sceneIds)
|
||||
|
||||
Reference in New Issue
Block a user