forked from DebaucheryLibrarian/traxxx
Added permanent filter for invalid actor associations.
This commit is contained in:
parent
ed7bffd2d6
commit
254e933740
|
@ -944,9 +944,15 @@ async function associateActors(releases, batchId) {
|
|||
})))
|
||||
.flat();
|
||||
|
||||
logger.debug(releaseActorAssociations);
|
||||
const validReleaseActorAssociations = releaseActorAssociations.filter(association => association.release_id && association.actor_id);
|
||||
|
||||
await bulkInsert('releases_actors', releaseActorAssociations, false);
|
||||
if (releaseActorAssociations.length > validReleaseActorAssociations.length) {
|
||||
const invalidReleaseActorAssociations = releaseActorAssociations.filter(association => !association.release_id || !association.actor_id);
|
||||
|
||||
logger.error(invalidReleaseActorAssociations);
|
||||
}
|
||||
|
||||
await bulkInsert('releases_actors', validReleaseActorAssociations, false);
|
||||
|
||||
logger.verbose(`Associated ${releaseActorAssociations.length} actors to ${releases.length} scenes`);
|
||||
|
||||
|
|
Loading…
Reference in New Issue