From d3c8221e146137445b66aacf078aa0fe2b66e3ec Mon Sep 17 00:00:00 2001 From: LmeSzinc <37934724+LmeSzinc@users.noreply.github.com> Date: Wed, 1 Nov 2023 01:21:51 +0800 Subject: [PATCH] Fix: Unknown stage name should not be considered as any chapter --- campaign/event_20210722_cn/campaign_base.py | 3 +-- module/campaign/campaign_ocr.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/campaign/event_20210722_cn/campaign_base.py b/campaign/event_20210722_cn/campaign_base.py index 3055f23d7..c0400be60 100644 --- a/campaign/event_20210722_cn/campaign_base.py +++ b/campaign/event_20210722_cn/campaign_base.py @@ -38,8 +38,7 @@ class CampaignBase(CampaignBase_): elif name[-1].isdigit(): return name[:-1], name[-1] - logger.warning(f'Unknown stage name: {name}') - return name[0], name[1:] + return CampaignBase_._campaign_separate_name(name) @staticmethod def _campaign_get_chapter_index(name): diff --git a/module/campaign/campaign_ocr.py b/module/campaign/campaign_ocr.py index 39ad4ad32..637481d7c 100644 --- a/module/campaign/campaign_ocr.py +++ b/module/campaign/campaign_ocr.py @@ -73,7 +73,7 @@ class CampaignOcr(ModuleBase): return '', '' logger.warning(f'Unknown stage name: {name}') - return name[0], name[1:] + return '', '' def campaign_match_multi(self, template, image, stage_image=None, name_offset=(75, 9), name_size=(60, 16), name_letter=(255, 255, 255), name_thresh=128, similarity=0.85):