fix: lookup movie by imdbid if tmdbid does not exits for plex movie agent (#711)

pull/712/head
Mārtiņš Možeiko 4 years ago committed by GitHub
parent 2bfab5e99c
commit e97228899a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -89,6 +89,15 @@ class JobPlexSync {
newMedia.tmdbId = Number(tmdbMatch);
}
});
if (newMedia.imdbId && !newMedia.tmdbId) {
const tmdbMovie = await this.tmdb.getMovieByImdbId({
imdbId: newMedia.imdbId,
});
newMedia.tmdbId = tmdbMovie.id;
}
if (!newMedia.tmdbId) {
throw new Error('Unable to find TMDB ID');
}
const has4k = metadata.Media.some(
(media) => media.videoResolution === '4k'

Loading…
Cancel
Save