mirror of
https://github.com/morpheus65535/bazarr.git
synced 2025-02-23 06:16:36 +08:00
Fix for Subliminal exception: 'list' object has no attribute 'lower'. This is panni's fix.
This commit is contained in:
parent
09206a91d8
commit
4dfc250287
1 changed files with 20 additions and 5 deletions
|
@ -6,6 +6,8 @@ import os
|
||||||
import chardet
|
import chardet
|
||||||
import pysrt
|
import pysrt
|
||||||
|
|
||||||
|
import types
|
||||||
|
|
||||||
from .score import get_equivalent_release_groups
|
from .score import get_equivalent_release_groups
|
||||||
from .video import Episode, Movie
|
from .video import Episode, Movie
|
||||||
from .utils import sanitize, sanitize_release_group
|
from .utils import sanitize, sanitize_release_group
|
||||||
|
@ -238,11 +240,24 @@ def guess_matches(video, guess, partial=False):
|
||||||
if video.resolution and 'screen_size' in guess and guess['screen_size'] == video.resolution:
|
if video.resolution and 'screen_size' in guess and guess['screen_size'] == video.resolution:
|
||||||
matches.add('resolution')
|
matches.add('resolution')
|
||||||
# format
|
# format
|
||||||
# Guessit may return a list for `format`, which indicates a conflict in the guessing.
|
if 'format' in guess:
|
||||||
# We should match `format` only when it returns single value to avoid false `format` matches
|
formats = guess["format"]
|
||||||
if video.format and guess.get('format') and not isinstance(guess['format'], list) \
|
if not isinstance(formats, types.ListType):
|
||||||
and guess['format'].lower() == video.format.lower():
|
formats = [formats]
|
||||||
matches.add('format')
|
|
||||||
|
if video.format:
|
||||||
|
video_format = video.format
|
||||||
|
if video_format in ("HDTV", "SDTV", "TV"):
|
||||||
|
video_format = "TV"
|
||||||
|
logger.debug("Treating HDTV/SDTV the same")
|
||||||
|
|
||||||
|
for frmt in formats:
|
||||||
|
if frmt in ("HDTV", "SDTV"):
|
||||||
|
frmt = "TV"
|
||||||
|
|
||||||
|
if frmt.lower() == video_format.lower():
|
||||||
|
matches.add('format')
|
||||||
|
break
|
||||||
# video_codec
|
# video_codec
|
||||||
if video.video_codec and 'video_codec' in guess and guess['video_codec'] == video.video_codec:
|
if video.video_codec and 'video_codec' in guess and guess['video_codec'] == video.video_codec:
|
||||||
matches.add('video_codec')
|
matches.add('video_codec')
|
||||||
|
|
Loading…
Reference in a new issue