Only using first name for actor determination.

This commit is contained in:
DebaucheryLibrarian 2024-03-23 02:47:52 +01:00
parent d3161d1017
commit 2e54cad36e
1 changed files with 5 additions and 2 deletions

View File

@ -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;
}