Only using first name for actor determination.
This commit is contained in:
parent
d3161d1017
commit
2e54cad36e
|
@ -75,11 +75,14 @@ export function sortActorsByGender(actors, context = {}) {
|
|||
|
||||
const titleSlug = slugify(context.title);
|
||||
const titleActors = titleSlug ? genderActors.sort((actorA, actorB) => {
|
||||
if (titleSlug.includes(actorA.slug) && !titleSlug.includes(actorB.slug)) {
|
||||
const actorASlug = actorA.slug.split('-')[0];
|
||||
const actorBSlug = actorB.slug.split('-')[0];
|
||||
|
||||
if (titleSlug.includes(actorASlug) && !titleSlug.includes(actorBSlug)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (titleSlug.includes(actorB.slug) && !titleSlug.includes(actorA.slug)) {
|
||||
if (titleSlug.includes(actorBSlug) && !titleSlug.includes(actorASlug)) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue