🐛 修复部分角色攻略未找到的问题

This commit is contained in:
omg-xtao 2022-10-14 21:17:53 +08:00 committed by GitHub
parent 893abde6ee
commit 68427d6aa3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,11 +17,14 @@ class GameStrategyService:
post_id: int = -1
post_full_in_collection = await self._hyperion.get_post_full_in_collection(collection_id)
for post_data in post_full_in_collection["posts"]:
title = post_data["post"]["subject"]
topics = post_data["topics"]
for topic in topics:
if character_name == topic["name"]:
post_id = int(post_data["post"]["post_id"])
break
if post_id == -1 and title and character_name in title:
post_id = int(post_data["post"]["post_id"])
if post_id != -1:
break
return post_id