1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-16 06:57:21 +08:00

Fix: Handle malformed or empty ocr campaign results

This commit is contained in:
nEEtdo0d
2021-01-10 13:16:07 -05:00
parent dffce6d4c6
commit 03ad5434bc

View File

@@ -166,6 +166,10 @@ class CampaignOcr(ModuleBase):
result = [self._campaign_ocr_result_process(res) for res in result]
chapter = [self._campaign_separate_name(res)[0] for res in result]
chapter = list(filter(('').__ne__, chapter))
if not chapter:
raise CampaignNameError
counter = collections.Counter(chapter)
self.campaign_chapter = counter.most_common()[0][0]