Added basic actor page with scenes and co-star filtering.

This commit is contained in:
2024-01-07 06:13:40 +01:00
parent ffcb77ab45
commit e32a366fff
14 changed files with 476 additions and 144 deletions

View File

@@ -45,13 +45,22 @@ export function sortActorsByGender(actors) {
return genderActors;
}
export async function fetchActorsById(actorIds) {
export async function fetchActorsById(actorIds, options = {}) {
const [actors] = await Promise.all([
knex('actors_meta')
.select('actors_meta.*')
.whereIn('actors_meta.id', actorIds),
.whereIn('actors_meta.id', actorIds)
.modify((builder) => {
if (options.order) {
builder.orderBy(...options.order);
}
}),
]);
if (options.order) {
return actors.map((actorEntry) => curateActor(actorEntry));
}
const curatedActors = actorIds.map((actorId) => {
const actor = actors.find((actorEntry) => actorEntry.id === actorId);