forked from DebaucheryLibrarian/traxxx
Transferring release media types separately to prevent race conditions.
This commit is contained in:
parent
042d3be4a9
commit
caf37ba9fb
|
@ -564,20 +564,22 @@ async function addRelease(release, context) {
|
||||||
entityName: entity.name,
|
entityName: entity.name,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
await addReleaseMedia([releaseWithId.poster], releaseWithId, 'posters', context);
|
||||||
|
|
||||||
|
if (release.type === 'release') {
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
addReleaseMedia([releaseWithId.poster], releaseWithId, 'posters', context),
|
|
||||||
...(release.type === 'release' ? [
|
|
||||||
addReleaseTags(releaseWithId, context),
|
addReleaseTags(releaseWithId, context),
|
||||||
addReleaseActors(releaseWithId, context),
|
addReleaseActors(releaseWithId, context),
|
||||||
addReleaseDirectors(releaseWithId, context),
|
addReleaseDirectors(releaseWithId, context),
|
||||||
addReleaseChapters(releaseWithId, context),
|
addReleaseChapters(releaseWithId, context),
|
||||||
addReleaseMedia(releaseWithId.photos, releaseWithId, 'photos', context),
|
|
||||||
linkMovieScenes(releaseWithId, context),
|
linkMovieScenes(releaseWithId, context),
|
||||||
] : []),
|
addReleaseMedia(releaseWithId.photos, releaseWithId, 'photos', context),
|
||||||
...(release.type === 'movie' ? [
|
|
||||||
addReleaseMedia(releaseWithId.covers, releaseWithId, 'covers', context),
|
|
||||||
] : []),
|
|
||||||
]);
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (release.type === 'movie') {
|
||||||
|
await addReleaseMedia(releaseWithId.covers, releaseWithId, 'covers', context);
|
||||||
|
}
|
||||||
|
|
||||||
return releaseWithId;
|
return releaseWithId;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue