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

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

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

Loading…
Cancel
Save