mirror of
https://github.com/morpheus65535/bazarr.git
synced 2025-01-04 05:52:24 +08:00
Fix bad identifier from frontend (#1361)
Co-authored-by: vitiko98 <averroista@þrotonmail.com>
This commit is contained in:
parent
940b6428dd
commit
7c61b3509c
2 changed files with 9 additions and 6 deletions
|
@ -225,8 +225,8 @@ const SettingsSubtitlesView: FunctionComponent = () => {
|
|||
<Input>
|
||||
<Check
|
||||
label="OCR Fixes"
|
||||
override={subzeroOverride("OCR_fixed")}
|
||||
settingKey="subzero-OCR_fixed"
|
||||
override={subzeroOverride("OCR_fixes")}
|
||||
settingKey="subzero-OCR_fixes"
|
||||
></Check>
|
||||
<Message>
|
||||
Fix issues that happen when a subtitle gets converted from bitmap to
|
||||
|
|
|
@ -34,12 +34,12 @@ class SubtitleModifications(object):
|
|||
|
||||
def load(self, fn=None, content=None, language=None, encoding="utf-8"):
|
||||
"""
|
||||
|
||||
|
||||
:param encoding: used for decoding the content when fn is given, not used in case content is given
|
||||
:param language: babelfish.Language language of the subtitle
|
||||
:param fn: filename
|
||||
:param content: unicode
|
||||
:return:
|
||||
:param content: unicode
|
||||
:return:
|
||||
"""
|
||||
if language:
|
||||
self.language = Language.rebuild(language, forced=False)
|
||||
|
@ -64,11 +64,14 @@ class SubtitleModifications(object):
|
|||
@classmethod
|
||||
def parse_identifier(cls, identifier):
|
||||
# simple identifier
|
||||
if identifier in registry.mods:
|
||||
# ("=" conditional used to avoid unpack exceptions related to bad
|
||||
# identifiers from old configs)
|
||||
if identifier in registry.mods or "=" not in identifier:
|
||||
return identifier, {}
|
||||
|
||||
# identifier with params; identifier(param=value)
|
||||
split_args = identifier[identifier.find("(")+1:-1].split(",")
|
||||
|
||||
args = dict((key, value) for key, value in [sub.split("=") for sub in split_args])
|
||||
return identifier[:identifier.find("(")], args
|
||||
|
||||
|
|
Loading…
Reference in a new issue