Added years filter. Changed default DMCA to generic content e-mail.
This commit is contained in:
@@ -8,6 +8,7 @@ export async function curateMoviesQuery(query) {
|
||||
return {
|
||||
scope: query.scope || 'latest',
|
||||
query: query.q,
|
||||
years: query.years?.split(',')?.map((year) => Number(year)).filter(Boolean) || [],
|
||||
actorIds: [query.actorId, ...(query.actors?.split(',') || []).map((identifier) => parseActorIdentifier(identifier)?.id)].filter(Boolean),
|
||||
tagIds: await getIdsBySlug([query.tagSlug, ...(query.tags?.split(',') || [])], 'tags'),
|
||||
entityId: query.e ? await getIdsBySlug([query.e], 'entities').then(([id]) => id) : query.entityId,
|
||||
@@ -19,6 +20,7 @@ export async function curateMoviesQuery(query) {
|
||||
export async function fetchMoviesApi(req, res) {
|
||||
const {
|
||||
movies,
|
||||
aggYears,
|
||||
aggActors,
|
||||
aggTags,
|
||||
aggChannels,
|
||||
@@ -31,6 +33,7 @@ export async function fetchMoviesApi(req, res) {
|
||||
|
||||
res.send(stringify({
|
||||
movies,
|
||||
aggYears,
|
||||
aggActors,
|
||||
aggTags,
|
||||
aggChannels,
|
||||
|
||||
@@ -7,6 +7,7 @@ import slugify from '../../utils/slugify.js';
|
||||
import promiseProps from '../../utils/promise-props.js';
|
||||
|
||||
export async function curateScenesQuery(query) {
|
||||
const splitYears = query.years?.split(',') || [];
|
||||
const splitTags = query.tags?.split(',') || [];
|
||||
const splitActors = query.actors?.split(',') || [];
|
||||
const splitEntities = query.e?.split(',') || [];
|
||||
@@ -27,6 +28,7 @@ export async function curateScenesQuery(query) {
|
||||
return {
|
||||
scope: query.scope || 'latest',
|
||||
query: query.q,
|
||||
years: splitYears.map((year) => Number(year)).filter(Boolean) || [],
|
||||
actorIds: [query.actorId, ...splitActors.filter((actor) => actor.charAt(0) !== '!').map((identifier) => parseActorIdentifier(identifier)?.id)].filter(Boolean),
|
||||
notActorIds: splitActors.filter((actor) => actor.charAt(0) === '!').map((identifier) => parseActorIdentifier(identifier.slice(1))?.id).filter(Boolean),
|
||||
tagIds,
|
||||
@@ -43,6 +45,7 @@ export async function curateScenesQuery(query) {
|
||||
export async function fetchScenesApi(req, res) {
|
||||
const {
|
||||
scenes,
|
||||
aggYears,
|
||||
aggActors,
|
||||
aggTags,
|
||||
aggChannels,
|
||||
@@ -58,6 +61,7 @@ export async function fetchScenesApi(req, res) {
|
||||
|
||||
res.send(stringify({
|
||||
scenes,
|
||||
aggYears,
|
||||
aggActors,
|
||||
aggTags,
|
||||
aggChannels,
|
||||
|
||||
Reference in New Issue
Block a user