From 03afe47ca2470d1e5d48f87e5d4dfa2c75b7338b Mon Sep 17 00:00:00 2001 From: pengtao Date: Wed, 15 Dec 2021 17:05:23 +0800 Subject: [PATCH] change dlclist --- main.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/main.py b/main.py index d1204d9..7486b4e 100644 --- a/main.py +++ b/main.py @@ -167,6 +167,17 @@ async def getgameinfoext(request: Request, oldGameId: int): db = request.app.state.mongo gameinfoext = db["gameinfoext"].find_one({"oldGameId": oldGameId}, {"_id": 0}) + + dlc_data = gameinfoext.get('dlcList') + new_data = list() + for one_line in dlc_data: + temp = {} + temp['name'] = one_line['name'] + temp['oldGameId'] = one_line['oldGameId'] + temp['price'] = one_line['price'] + temp['icon'] = one_line['icon'] + new_data.append(temp) + gameinfoext['dlcList'] = new_data logger.info(f"get gameinfoext with {oldGameId} !") return JSONResponse( status_code=starlette.status.HTTP_200_OK,