Fix: campaign_ocr result start with '-'

This commit is contained in:
LmeSzinc 2020-05-28 07:29:42 +08:00
parent e885665181
commit 3e687c4b23

View File

@ -31,6 +31,8 @@ def ensure_chapter_index(name):
def ocr_result_process(result): def ocr_result_process(result):
result = result.lower().replace('--', '-') result = result.lower().replace('--', '-')
if result.startswith('-'):
result = result[1:]
if len(result) == 2 and result[0].isdigit(): if len(result) == 2 and result[0].isdigit():
result = '-'.join(result) result = '-'.join(result)
return result return result