Added basic actor page with scenes and co-star filtering.
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user