1
This commit is contained in:
parent
3a8712b357
commit
b80ee7f433
7
main.py
7
main.py
@ -193,14 +193,13 @@ async def getgameprice(request: Request, oldGameId: int, nums: int = 0):
|
|||||||
gameprice = db["gameprice"].find_one({"oldGameId": oldGameId},
|
gameprice = db["gameprice"].find_one({"oldGameId": oldGameId},
|
||||||
{"_id": 0})
|
{"_id": 0})
|
||||||
else:
|
else:
|
||||||
gameprice = db["gameprice"].find_one({"oldGameId": oldGameId},
|
gameprice = db["gameprice"].find({"oldGameId": oldGameId}, {"_id": 0})
|
||||||
{"_id": 0})
|
|
||||||
if gameprice:
|
if gameprice:
|
||||||
price = gameprice.get('prices', [])
|
price = gameprice.get('prices', [])
|
||||||
gameprice['prices'] = price[:nums]
|
gameprice['prices'] = price[:nums]
|
||||||
else:
|
else:
|
||||||
logger.error(f"get price with {oldGameId} failed\n {gameprice}")
|
logger.error(f"get price with {oldGameId} failed\n {gameprice}")
|
||||||
gameprice = []
|
gameprice = {}
|
||||||
|
|
||||||
logger.info(f"get gameprice with {oldGameId} !")
|
logger.info(f"get gameprice with {oldGameId} !")
|
||||||
return JSONResponse(
|
return JSONResponse(
|
||||||
@ -217,7 +216,7 @@ async def getgameinfoext(request: Request, oldGameId: int):
|
|||||||
if not gameinfoext:
|
if not gameinfoext:
|
||||||
return JSONResponse(
|
return JSONResponse(
|
||||||
status_code=starlette.status.HTTP_200_OK,
|
status_code=starlette.status.HTTP_200_OK,
|
||||||
content="",
|
content={},
|
||||||
)
|
)
|
||||||
dlc_data = gameinfoext.get('dlcList')
|
dlc_data = gameinfoext.get('dlcList')
|
||||||
new_data = list()
|
new_data = list()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user