Skip to content

Commit

Permalink
helper: commands: resolve: fix movie resolution
Browse files Browse the repository at this point in the history
Commit f436460 introduced a
bug by converting the imdb id returned in the URL form by
imdbpie to the imdb id alone, and doing so for the
'parentTitle' of the media, which represents a series for
a TV episode, but does not exist for a movie. This commit
fixes that behavior by checking that the 'parentTitle'
exists before applying the conversion at its level.

Fixes #119

Signed-off-by: Raphaël Beamonte <[email protected]>
  • Loading branch information
xaf committed Jun 21, 2018
1 parent 9b9d57c commit 7851368
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions helper/commands/resolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -1006,8 +1006,9 @@ def insert_hash(media, ratio):

# Return in the form of a list
media['base']['imdbid'] = media['base']['id'][7:-1]
media['base']['parentTitle']['imdbid'] = \
media['base']['parentTitle']['id'][7:-1]
if 'parentTitle' in media['base']:
media['base']['parentTitle']['imdbid'] = \
media['base']['parentTitle']['id'][7:-1]
media_list = [media, ]

# If it was an episode, and we had more episodes in the list...
Expand Down

0 comments on commit 7851368

Please sign in to comment.