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,
|
||||
};
|
||||
|
||||
await Promise.all([
|
||||
addReleaseMedia([releaseWithId.poster], releaseWithId, 'posters', context),
|
||||
...(release.type === 'release' ? [
|
||||
await addReleaseMedia([releaseWithId.poster], releaseWithId, 'posters', context);
|
||||
|
||||
if (release.type === 'release') {
|
||||
await Promise.all([
|
||||
addReleaseTags(releaseWithId, context),
|
||||
addReleaseActors(releaseWithId, context),
|
||||
addReleaseDirectors(releaseWithId, context),
|
||||
addReleaseChapters(releaseWithId, context),
|
||||
addReleaseMedia(releaseWithId.photos, releaseWithId, 'photos', context),
|
||||
linkMovieScenes(releaseWithId, context),
|
||||
] : []),
|
||||
...(release.type === 'movie' ? [
|
||||
addReleaseMedia(releaseWithId.covers, releaseWithId, 'covers', context),
|
||||
] : []),
|
||||
]);
|
||||
addReleaseMedia(releaseWithId.photos, releaseWithId, 'photos', context),
|
||||
]);
|
||||
}
|
||||
|
||||
if (release.type === 'movie') {
|
||||
await addReleaseMedia(releaseWithId.covers, releaseWithId, 'covers', context);
|
||||
}
|
||||
|
||||
return releaseWithId;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue