Aggregating channels, filter inoperable.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { stringify } from '@brillout/json-serializer/stringify'; /* eslint-disable-line import/extensions */
|
||||
|
||||
import { fetchScenes } from '../scenes.js';
|
||||
import { parseActorIdentifier } from '../query.js';
|
||||
import redis from '../redis.js';
|
||||
|
||||
async function getTagIdsBySlug(tagSlugs) {
|
||||
@@ -24,7 +25,7 @@ async function getTagIdsBySlug(tagSlugs) {
|
||||
export async function curateScenesQuery(query) {
|
||||
return {
|
||||
scope: query.scope || 'latest',
|
||||
actorIds: [query.actorId, ...(query.actors?.split(',') || [])].filter(Boolean).map((actorId) => Number(actorId)),
|
||||
actorIds: [query.actorId, ...(query.actors?.split(',') || []).map((identifier) => parseActorIdentifier(identifier)?.id)].filter(Boolean),
|
||||
tagIds: await getTagIdsBySlug([query.tagId, ...(query.tags?.split(',') || [])]),
|
||||
};
|
||||
}
|
||||
@@ -34,6 +35,7 @@ export async function fetchScenesApi(req, res) {
|
||||
scenes,
|
||||
aggActors,
|
||||
aggTags,
|
||||
aggChannels,
|
||||
limit,
|
||||
total,
|
||||
} = await fetchScenes(await curateScenesQuery(req.query), {
|
||||
@@ -45,6 +47,7 @@ export async function fetchScenesApi(req, res) {
|
||||
scenes,
|
||||
aggActors,
|
||||
aggTags,
|
||||
aggChannels,
|
||||
limit,
|
||||
total,
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user