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()