fix(api): filter out adult content from combined credits

pull/814/head
sct 4 years ago
parent a3b00c3458
commit 3052f12c91

@ -42,7 +42,8 @@ personRoutes.get('/:id/combined_credits', async (req, res) => {
);
return res.status(200).json({
cast: combinedCredits.cast.map((result) =>
cast: combinedCredits.cast
.map((result) =>
mapCastCredits(
result,
castMedia.find(
@ -50,8 +51,10 @@ personRoutes.get('/:id/combined_credits', async (req, res) => {
med.tmdbId === result.id && med.mediaType === result.media_type
)
)
),
crew: combinedCredits.crew.map((result) =>
)
.filter((item) => !item.adult),
crew: combinedCredits.crew
.map((result) =>
mapCrewCredits(
result,
crewMedia.find(
@ -59,7 +62,8 @@ personRoutes.get('/:id/combined_credits', async (req, res) => {
med.tmdbId === result.id && med.mediaType === result.media_type
)
)
),
)
.filter((item) => !item.adult),
id: combinedCredits.id,
});
});

Loading…
Cancel
Save