From bb85224826bd6e8950fbf7aa1a10bf893f57fcc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis=20V=C3=A9zina?= <5130500+morpheus65535@users.noreply.github.com> Date: Wed, 10 Oct 2018 22:33:08 -0400 Subject: [PATCH] Fix for guessit returning a list for format --- libs/subliminal/subtitle.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libs/subliminal/subtitle.py b/libs/subliminal/subtitle.py index 726b28e37..83beab63a 100644 --- a/libs/subliminal/subtitle.py +++ b/libs/subliminal/subtitle.py @@ -238,7 +238,10 @@ def guess_matches(video, guess, partial=False): if video.resolution and 'screen_size' in guess and guess['screen_size'] == video.resolution: matches.add('resolution') # format - if video.format and 'format' in guess and guess['format'].lower() == video.format.lower(): + # Guessit may return a list for `format`, which indicates a conflict in the guessing. + # We should match `format` only when it returns single value to avoid false `format` matches + if video.format and guess.get('format') and not isinstance(guess['format'], list) \ + and guess['format'].lower() == video.format.lower(): matches.add('format') # video_codec if video.video_codec and 'video_codec' in guess and guess['video_codec'] == video.video_codec: