Improved actor mapping in release associations. Storing alias ID in actor release association.

This commit is contained in:
DebaucheryLibrarian
2021-02-17 00:40:20 +01:00
parent 3469da674a
commit c51cd080fa
3 changed files with 28 additions and 4 deletions

View File

@@ -222,7 +222,11 @@ function actors(release) {
: Math.floor(Math.random() * 3) + 2;
return Array.from({ length }, () => ({
name: faker.name.findName(),
name: faker.name
.findName()
.split(' ')
.slice(0, Math.random() < 0.2 ? 1 : 2) // sometimes only use the first name
.join(' '),
gender: gender(),
}));
}
@@ -258,8 +262,7 @@ async function fetchLatest(entity, page, options) {
.limit(faker.random.number({ min: 2, max: 15 }))
.pluck('name');
// release.actors = [...actors(release), null]; // include empty actor to ensure proper handling
release.actors = ['Amber'];
release.actors = [...actors(release), null]; // include empty actor to ensure proper handling
release.title = title(release);
return release;