mirror of
https://github.com/morpheus65535/bazarr.git
synced 2025-01-01 12:32:25 +08:00
Fixed uppercase detection mod with multiline HI
This commit is contained in:
parent
88c9d67cf1
commit
68a0d78725
1 changed files with 14 additions and 14 deletions
|
@ -184,22 +184,22 @@ class SubtitleModifications(object):
|
|||
entries_used = 0
|
||||
for entry in self.f:
|
||||
entry_used = False
|
||||
for sub in entry.text.strip().split(r"\N"):
|
||||
# skip HI bracket entries, those might actually be lowercase
|
||||
sub = sub.strip()
|
||||
for processor in registry.mods["remove_HI"].processors[:4]:
|
||||
sub = processor.process(sub)
|
||||
sub = entry.text
|
||||
# skip HI bracket entries, those might actually be lowercase
|
||||
sub = sub.strip()
|
||||
for processor in registry.mods["remove_HI"].processors[:4]:
|
||||
sub = processor.process(sub)
|
||||
|
||||
if sub.strip():
|
||||
# only consider alphabetic characters to determine if uppercase
|
||||
alpha_sub = ''.join([i for i in sub if i.isalpha()])
|
||||
if alpha_sub and not alpha_sub.isupper():
|
||||
return False
|
||||
if sub.strip():
|
||||
# only consider alphabetic characters to determine if uppercase
|
||||
alpha_sub = ''.join([i for i in sub if i.isalpha()])
|
||||
if alpha_sub and not alpha_sub.isupper():
|
||||
return False
|
||||
|
||||
entry_used = True
|
||||
else:
|
||||
# skip full entry
|
||||
break
|
||||
entry_used = True
|
||||
else:
|
||||
# skip full entry
|
||||
break
|
||||
|
||||
if entry_used:
|
||||
entries_used += 1
|
||||
|
|
Loading…
Reference in a new issue