diff --git a/titles/chuni/new.py b/titles/chuni/new.py index 2275a6e..3d3fb98 100644 --- a/titles/chuni/new.py +++ b/titles/chuni/new.py @@ -104,7 +104,8 @@ class ChuniNew(ChuniBase): return {"returnCode": "1"} async def handle_get_user_map_area_api_request(self, data: Dict) -> Dict: - user_map_areas = await self.data.item.get_map_areas(data["userId"]) + map_area_ids = [int(area["mapAreaId"]) for area in data["mapAreaIdList"]] + user_map_areas = await self.data.item.get_map_areas(data["userId"], map_area_ids) map_areas = [] for map_area in user_map_areas: diff --git a/titles/chuni/schema/item.py b/titles/chuni/schema/item.py index 30db4b8..9ce2c53 100644 --- a/titles/chuni/schema/item.py +++ b/titles/chuni/schema/item.py @@ -533,8 +533,8 @@ class ChuniItemData(BaseData): return None return result.lastrowid - async def get_map_areas(self, user_id: int) -> Optional[List[Row]]: - sql = select(map_area).where(map_area.c.user == user_id) + async def get_map_areas(self, user_id: int, map_area_ids: List[int]) -> Optional[List[Row]]: + sql = select(map_area).where(map_area.c.user == user_id, map_area.c.mapAreaId.in_(map_area_ids)) result = await self.execute(sql) if result is None: