mirror of
https://github.com/morpheus65535/bazarr.git
synced 2025-02-21 21:34:48 +08:00
Fix for guessit returning a list for format
This commit is contained in:
parent
80eaa7a21e
commit
bb85224826
1 changed files with 4 additions and 1 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue