mirror of
https://github.com/sct/overseerr.git
synced 2025-09-30 15:40:40 +02:00
fix(plex): find TV series in addition to movies from IMDb IDs (#1830)
This commit is contained in:
@@ -561,13 +561,13 @@ class TheMovieDb extends ExternalAPI {
|
||||
}
|
||||
}
|
||||
|
||||
public async getMovieByImdbId({
|
||||
public async getMediaByImdbId({
|
||||
imdbId,
|
||||
language = 'en',
|
||||
}: {
|
||||
imdbId: string;
|
||||
language?: string;
|
||||
}): Promise<TmdbMovieDetails> {
|
||||
}): Promise<TmdbMovieDetails | TmdbTvDetails> {
|
||||
try {
|
||||
const extResponse = await this.getByExternalId({
|
||||
externalId: imdbId,
|
||||
@@ -583,12 +583,19 @@ class TheMovieDb extends ExternalAPI {
|
||||
return movie;
|
||||
}
|
||||
|
||||
throw new Error(
|
||||
'[TMDb] Failed to find a title with the provided IMDB id'
|
||||
);
|
||||
if (extResponse.tv_results[0]) {
|
||||
const tvshow = await this.getTvShow({
|
||||
tvId: extResponse.tv_results[0].id,
|
||||
language,
|
||||
});
|
||||
|
||||
return tvshow;
|
||||
}
|
||||
|
||||
throw new Error(`No movie or show returned from API for ID ${imdbId}`);
|
||||
} catch (e) {
|
||||
throw new Error(
|
||||
`[TMDb] Failed to get movie by external imdb ID: ${e.message}`
|
||||
`[TMDb] Failed to find media using external IMDb ID: ${e.message}`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user