|
1 | 1 | import TheMovieDb from '@server/api/themoviedb';
|
2 |
| -import { MediaStatus } from '@server/constants/media'; |
3 | 2 | import Media from '@server/entity/Media';
|
4 |
| -import { getSettings } from '@server/lib/settings'; |
5 | 3 | import logger from '@server/logger';
|
6 | 4 | import {
|
7 | 5 | mapCastCredits,
|
@@ -36,38 +34,21 @@ personRoutes.get('/:id', async (req, res, next) => {
|
36 | 34 |
|
37 | 35 | personRoutes.get('/:id/combined_credits', async (req, res, next) => {
|
38 | 36 | const tmdb = new TheMovieDb();
|
39 |
| - const settings = getSettings(); |
40 | 37 |
|
41 | 38 | try {
|
42 | 39 | const combinedCredits = await tmdb.getPersonCombinedCredits({
|
43 | 40 | personId: Number(req.params.id),
|
44 | 41 | language: req.locale ?? (req.query.language as string),
|
45 | 42 | });
|
46 | 43 |
|
47 |
| - let castMedia = await Media.getRelatedMedia( |
| 44 | + const castMedia = await Media.getRelatedMedia( |
48 | 45 | combinedCredits.cast.map((result) => result.id)
|
49 | 46 | );
|
50 | 47 |
|
51 |
| - let crewMedia = await Media.getRelatedMedia( |
| 48 | + const crewMedia = await Media.getRelatedMedia( |
52 | 49 | combinedCredits.crew.map((result) => result.id)
|
53 | 50 | );
|
54 | 51 |
|
55 |
| - if (settings.main.hideAvailable) { |
56 |
| - castMedia = castMedia.filter( |
57 |
| - (media) => |
58 |
| - (media.mediaType === 'movie' || media.mediaType === 'tv') && |
59 |
| - media.status !== MediaStatus.AVAILABLE && |
60 |
| - media.status !== MediaStatus.PARTIALLY_AVAILABLE |
61 |
| - ); |
62 |
| - |
63 |
| - crewMedia = crewMedia.filter( |
64 |
| - (media) => |
65 |
| - (media.mediaType === 'movie' || media.mediaType === 'tv') && |
66 |
| - media.status !== MediaStatus.AVAILABLE && |
67 |
| - media.status !== MediaStatus.PARTIALLY_AVAILABLE |
68 |
| - ); |
69 |
| - } |
70 |
| - |
71 | 52 | return res.status(200).json({
|
72 | 53 | cast: combinedCredits.cast
|
73 | 54 | .map((result) =>
|
|
0 commit comments