summaryrefslogtreecommitdiffhomepage
path: root/libs/subliminal
diff options
context:
space:
mode:
authorLouis Vézina <[email protected]>2018-10-10 22:33:08 -0400
committerLouis Vézina <[email protected]>2018-10-10 22:33:08 -0400
commitbb85224826bd6e8950fbf7aa1a10bf893f57fcc1 (patch)
tree6b1c3bea0ff217d07fbc27a9a9e978e156867e4a /libs/subliminal
parent80eaa7a21ea261e59d9788cc3706f9fd1e0127c1 (diff)
downloadbazarr-bb85224826bd6e8950fbf7aa1a10bf893f57fcc1.tar.gz
bazarr-bb85224826bd6e8950fbf7aa1a10bf893f57fcc1.zip
Fix for guessit returning a list for format
Diffstat (limited to 'libs/subliminal')
-rw-r--r--libs/subliminal/subtitle.py5
1 files changed, 4 insertions, 1 deletions
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: