From b80ee7f433f09ffe7bd52889066935289dff33ba Mon Sep 17 00:00:00 2001 From: pengtao Date: Mon, 20 Dec 2021 11:39:47 +0800 Subject: [PATCH] 1 --- main.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index 8649afd..b5ed796 100644 --- a/main.py +++ b/main.py @@ -193,14 +193,13 @@ async def getgameprice(request: Request, oldGameId: int, nums: int = 0): gameprice = db["gameprice"].find_one({"oldGameId": oldGameId}, {"_id": 0}) else: - gameprice = db["gameprice"].find_one({"oldGameId": oldGameId}, - {"_id": 0}) + gameprice = db["gameprice"].find({"oldGameId": oldGameId}, {"_id": 0}) if gameprice: price = gameprice.get('prices', []) gameprice['prices'] = price[:nums] else: logger.error(f"get price with {oldGameId} failed\n {gameprice}") - gameprice = [] + gameprice = {} logger.info(f"get gameprice with {oldGameId} !") return JSONResponse( @@ -217,7 +216,7 @@ async def getgameinfoext(request: Request, oldGameId: int): if not gameinfoext: return JSONResponse( status_code=starlette.status.HTTP_200_OK, - content="", + content={}, ) dlc_data = gameinfoext.get('dlcList') new_data = list()