Catching actor association errors so it does not inhibit media association.

This commit is contained in:
DebaucheryLibrarian 2021-02-23 04:09:33 +01:00
parent f44cb8bf4c
commit fae288633c
1 changed files with 45 additions and 39 deletions

View File

@ -891,6 +891,7 @@ async function getOrCreateActors(baseActors, batchId) {
} }
async function associateActors(releases, batchId) { async function associateActors(releases, batchId) {
try {
const baseActorsByReleaseId = releases.reduce((acc, release) => { const baseActorsByReleaseId = releases.reduce((acc, release) => {
if (release.actors) { if (release.actors) {
acc[release.id] = toBaseActors(release.actors, release); acc[release.id] = toBaseActors(release.actors, release);
@ -940,6 +941,11 @@ async function associateActors(releases, batchId) {
logger.verbose(`Associated ${releaseActorAssociations.length} actors to ${releases.length} scenes`); logger.verbose(`Associated ${releaseActorAssociations.length} actors to ${releases.length} scenes`);
return actors; return actors;
} catch (error) {
logger.error(`Failed to associate actors: ${error.message}`);
return [];
}
} }
async function fetchActor(actorId) { async function fetchActor(actorId) {