summaryrefslogtreecommitdiffhomepage
path: root/libs/knowit/rules/subtitle.py
diff options
context:
space:
mode:
authormorpheus65535 <[email protected]>2023-03-21 23:15:01 -0400
committermorpheus65535 <[email protected]>2023-03-21 23:15:01 -0400
commit7455496c4c42518df5f20646d50a93ca66c1a912 (patch)
treef7992557e15e6d8c8494edb2789772aa4b0dce44 /libs/knowit/rules/subtitle.py
parent71363830985a34f5f45a32972477e0ac83dce519 (diff)
downloadbazarr-1.2.1-beta.9.tar.gz
bazarr-1.2.1-beta.9.zip
Trying to fix Segmentation fault caused by mediainfo in docker container. #2098v1.2.1-beta.9
Diffstat (limited to 'libs/knowit/rules/subtitle.py')
-rw-r--r--libs/knowit/rules/subtitle.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/libs/knowit/rules/subtitle.py b/libs/knowit/rules/subtitle.py
index fa16fdbc1..704109f99 100644
--- a/libs/knowit/rules/subtitle.py
+++ b/libs/knowit/rules/subtitle.py
@@ -10,18 +10,19 @@ class ClosedCaptionRule(Rule):
def execute(self, props, pv_props, context):
"""Execute closed caption rule."""
- for name in (pv_props.get('_closed_caption'), props.get('name')):
- if name and self.cc_re.search(name):
- return True
+ if '_closed_caption' in pv_props and self.cc_re.search(pv_props['_closed_caption']):
+ return True
+
+ if 'guessed' in pv_props:
+ guessed = pv_props['guessed']
+ return guessed.get('closed_caption')
class HearingImpairedRule(Rule):
"""Hearing Impaired rule."""
- hi_re = re.compile(r'(\bsdh\b)', re.IGNORECASE)
-
def execute(self, props, pv_props, context):
"""Hearing Impaired."""
- name = props.get('name')
- if name and self.hi_re.search(name):
- return True
+ if 'guessed' in pv_props:
+ guessed = pv_props['guessed']
+ return guessed.get('hearing_impaired')