diff --git a/server/api/themoviedb/interfaces.ts b/server/api/themoviedb/interfaces.ts index c39ac637e8..6d005dc94d 100644 --- a/server/api/themoviedb/interfaces.ts +++ b/server/api/themoviedb/interfaces.ts @@ -372,7 +372,8 @@ export interface TmdbPersonCombinedCredits { crew: TmdbPersonCreditCrew[]; } -export interface TmdbSeasonWithEpisodes extends TmdbTvSeasonResult { +export interface TmdbSeasonWithEpisodes + extends Omit { episodes: TmdbTvEpisodeResult[]; external_ids: TmdbExternalIds; } diff --git a/server/job/schedule.ts b/server/job/schedule.ts index 29dabc1355..ab606449d3 100644 --- a/server/job/schedule.ts +++ b/server/job/schedule.ts @@ -63,7 +63,7 @@ export const startJobs = (): void => { id: 'plex-watchlist-sync', name: 'Plex Watchlist Sync', type: 'process', - interval: 'long', + interval: 'short', cronSchedule: jobs['plex-watchlist-sync'].schedule, job: schedule.scheduleJob(jobs['plex-watchlist-sync'].schedule, () => { logger.info('Starting scheduled job: Plex Watchlist Sync', { diff --git a/server/models/Tv.ts b/server/models/Tv.ts index fb719bef06..24362b5044 100644 --- a/server/models/Tv.ts +++ b/server/models/Tv.ts @@ -50,7 +50,7 @@ interface Season { seasonNumber: number; } -export interface SeasonWithEpisodes extends Season { +export interface SeasonWithEpisodes extends Omit { episodes: Episode[]; externalIds: ExternalIds; } @@ -141,7 +141,6 @@ export const mapSeasonWithEpisodes = ( season: TmdbSeasonWithEpisodes ): SeasonWithEpisodes => ({ airDate: season.air_date, - episodeCount: season.episode_count, episodes: season.episodes.map(mapEpisodeResult), externalIds: mapExternalIds(season.external_ids), id: season.id, diff --git a/server/routes/person.ts b/server/routes/person.ts index 7f5d62236b..009d62af73 100644 --- a/server/routes/person.ts +++ b/server/routes/person.ts @@ -1,5 +1,7 @@ import TheMovieDb from '@server/api/themoviedb'; +import { MediaStatus } from '@server/constants/media'; import Media from '@server/entity/Media'; +import { getSettings } from '@server/lib/settings'; import logger from '@server/logger'; import { mapCastCredits, @@ -34,6 +36,7 @@ personRoutes.get('/:id', async (req, res, next) => { personRoutes.get('/:id/combined_credits', async (req, res, next) => { const tmdb = new TheMovieDb(); + const settings = getSettings(); try { const combinedCredits = await tmdb.getPersonCombinedCredits({ @@ -41,14 +44,30 @@ personRoutes.get('/:id/combined_credits', async (req, res, next) => { language: req.locale ?? (req.query.language as string), }); - const castMedia = await Media.getRelatedMedia( + let castMedia = await Media.getRelatedMedia( combinedCredits.cast.map((result) => result.id) ); - const crewMedia = await Media.getRelatedMedia( + let crewMedia = await Media.getRelatedMedia( combinedCredits.crew.map((result) => result.id) ); + if (settings.main.hideAvailable) { + castMedia = castMedia.filter( + (media) => + (media.mediaType === 'movie' || media.mediaType === 'tv') && + media.status !== MediaStatus.AVAILABLE && + media.status !== MediaStatus.PARTIALLY_AVAILABLE + ); + + crewMedia = crewMedia.filter( + (media) => + (media.mediaType === 'movie' || media.mediaType === 'tv') && + media.status !== MediaStatus.AVAILABLE && + media.status !== MediaStatus.PARTIALLY_AVAILABLE + ); + } + return res.status(200).json({ cast: combinedCredits.cast .map((result) => diff --git a/src/components/Common/Tooltip/index.tsx b/src/components/Common/Tooltip/index.tsx index b0c4fb2eb0..82bc7a7a9d 100644 --- a/src/components/Common/Tooltip/index.tsx +++ b/src/components/Common/Tooltip/index.tsx @@ -20,7 +20,7 @@ const Tooltip = ({ children, content, tooltipConfig }: TooltipProps) => { return ( <> {React.cloneElement(children, { ref: setTriggerRef })} - {visible && ( + {visible && content && (
{
-