mirror of
https://github.com/Murasame-Dev/McStatus-API.git
synced 2025-12-14 12:18:03 +00:00
fix: requirements and some syntax fix.
This commit is contained in:
parent
ac7ecb183e
commit
1a9def0a23
3 changed files with 12 additions and 7 deletions
6
app.py
6
app.py
|
|
@ -107,7 +107,7 @@ async def get_status_image(ip: str = Query(None, description="服务器IP地址
|
|||
background_data = f.read()
|
||||
|
||||
# 字体设置方法
|
||||
if not FONT_PATH or FONT_PATH == "":
|
||||
if not FONT_PATH:
|
||||
font_url = None
|
||||
else:
|
||||
font_url = FONT_PATH
|
||||
|
|
@ -152,11 +152,11 @@ async def get_status_image(ip: str = Query(None, description="服务器IP地址
|
|||
icon_data = await get_icon_image(DEFAULT_ICON)
|
||||
|
||||
# 图片尺寸
|
||||
if not IMAGE_WIDTH == 0 or IMAGE_HEIGHT == 0:
|
||||
if not IMAGE_WIDTH or not IMAGE_HEIGHT:
|
||||
image_size = [0,0]
|
||||
else:
|
||||
image_size = [IMAGE_WIDTH, IMAGE_HEIGHT]
|
||||
|
||||
|
||||
image = await loop.run_in_executor(None,
|
||||
create_image,
|
||||
background_data,
|
||||
|
|
|
|||
|
|
@ -5,7 +5,11 @@ description = "A Minecraft Server status API based on FastAPI"
|
|||
readme = "README.md"
|
||||
requires-python = ">=3.13"
|
||||
dependencies = [
|
||||
"fastapi[standard]>=0.115.0",
|
||||
"uvicorn>=0.30.0",
|
||||
"mcstatus>=12.0.5",
|
||||
"fastapi>=0.110.0",
|
||||
"gunicorn>=21.2.0",
|
||||
"uvicorn[standard]>=0.29.0",
|
||||
"httpx>=0.27.0",
|
||||
"pillow>=10.3.0",
|
||||
"dnspython>=2.6.1"
|
||||
"mcstatus>= 12.0.5"
|
||||
]
|
||||
|
|
|
|||
|
|
@ -3,4 +3,5 @@ gunicorn>=21.2.0
|
|||
uvicorn[standard]>=0.29.0
|
||||
httpx>=0.27.0
|
||||
pillow>=10.3.0
|
||||
dnspython>=2.6.1
|
||||
dnspython>=2.6.1
|
||||
mcstatus>= 12.0.5
|
||||
Loading…
Add table
Add a link
Reference in a new issue