Skip to content

Commit

Permalink
fix: lookup movie by imdbid if tmdbid does not exits for plex movie a…
Browse files Browse the repository at this point in the history
…gent (#711)
  • Loading branch information
mmozeiko committed Jan 21, 2021
1 parent 2bfab5e commit e972288
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions server/job/plexsync/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit e972288

Please sign in to comment.