mirror of
https://github.com/morpheus65535/bazarr.git
synced 2024-11-10 09:02:44 +08:00
Add default attribute to Subtitle
This commit is contained in:
parent
a67da7dd9e
commit
718bd2f8b9
2 changed files with 11 additions and 10 deletions
|
@ -50,6 +50,8 @@ class Subtitle(object):
|
|||
#: Encoding to decode with when accessing :attr:`text`
|
||||
self.encoding = None
|
||||
|
||||
self.release_info = None
|
||||
|
||||
# validate the encoding
|
||||
if encoding:
|
||||
try:
|
||||
|
|
|
@ -187,16 +187,15 @@ class SZProviderPool(ProviderPool):
|
|||
if (str(provider), str(s.id)) in self.blacklist:
|
||||
logger.info("Skipping blacklisted subtitle: %s", s)
|
||||
continue
|
||||
if hasattr(s, 'release_info'):
|
||||
if s.release_info is not None:
|
||||
if any([x for x in self.ban_list["must_not_contain"]
|
||||
if re.search(x, s.release_info, flags=re.IGNORECASE) is not None]):
|
||||
logger.info("Skipping subtitle because release name contains prohibited string: %s", s)
|
||||
continue
|
||||
if any([x for x in self.ban_list["must_contain"]
|
||||
if re.search(x, s.release_info, flags=re.IGNORECASE) is None]):
|
||||
logger.info("Skipping subtitle because release name does not contains required string: %s", s)
|
||||
continue
|
||||
if s.release_info is not None:
|
||||
if any([x for x in self.ban_list["must_not_contain"]
|
||||
if re.search(x, s.release_info, flags=re.IGNORECASE) is not None]):
|
||||
logger.info("Skipping subtitle because release name contains prohibited string: %s", s)
|
||||
continue
|
||||
if any([x for x in self.ban_list["must_contain"]
|
||||
if re.search(x, s.release_info, flags=re.IGNORECASE) is None]):
|
||||
logger.info("Skipping subtitle because release name does not contains required string: %s", s)
|
||||
continue
|
||||
if s.id in seen:
|
||||
continue
|
||||
s.plex_media_fps = float(video.fps) if video.fps else None
|
||||
|
|
Loading…
Reference in a new issue