mirror of
https://github.com/A-Minos/nonebot-plugin-tetris-stats.git
synced 2026-03-05 05:36:54 +08:00
✨ 使用新模板
This commit is contained in:
@@ -52,8 +52,8 @@ class HostPage:
|
|||||||
@driver.on_startup
|
@driver.on_startup
|
||||||
def _():
|
def _():
|
||||||
app.mount(
|
app.mount(
|
||||||
'/host/assets',
|
'/host/_nuxt',
|
||||||
StaticFiles(directory=TEMPLATES_DIR / 'assets'),
|
StaticFiles(directory=TEMPLATES_DIR / '_nuxt'),
|
||||||
name='assets',
|
name='assets',
|
||||||
)
|
)
|
||||||
logger.success('assets mounted')
|
logger.success('assets mounted')
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ async def download_templates(tag: str) -> Path:
|
|||||||
tag = (
|
tag = (
|
||||||
(
|
(
|
||||||
await client.get(
|
await client.get(
|
||||||
'https://github.com/A-Minos/tetris-stats-templates/releases/latest', follow_redirects=True
|
'https://github.com/A-Minos/tetris-stats-templates-new/releases/latest', follow_redirects=True
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
.url.path.strip('/')
|
.url.path.strip('/')
|
||||||
@@ -43,7 +43,7 @@ async def download_templates(tag: str) -> Path:
|
|||||||
async with (
|
async with (
|
||||||
client.stream(
|
client.stream(
|
||||||
'GET',
|
'GET',
|
||||||
f'https://github.com/A-Minos/tetris-stats-templates/releases/download/{tag}/dist.zip',
|
f'https://github.com/A-Minos/tetris-stats-templates-new/releases/download/{tag}/dist.zip',
|
||||||
follow_redirects=True,
|
follow_redirects=True,
|
||||||
) as response,
|
) as response,
|
||||||
aopen(path, 'wb') as file,
|
aopen(path, 'wb') as file,
|
||||||
@@ -107,7 +107,7 @@ async def init_templates(tag: str) -> bool:
|
|||||||
async def check_tag(tag: str) -> bool:
|
async def check_tag(tag: str) -> bool:
|
||||||
async with AsyncClient(proxy=config.tetris.proxy.github or config.tetris.proxy.main) as client:
|
async with AsyncClient(proxy=config.tetris.proxy.github or config.tetris.proxy.main) as client:
|
||||||
return (
|
return (
|
||||||
await client.get(f'https://github.com/A-Minos/tetris-stats-templates/releases/tag/{tag}')
|
await client.get(f'https://github.com/A-Minos/tetris-stats-templates-new/releases/tag/{tag}')
|
||||||
).status_code != HTTPStatus.NOT_FOUND
|
).status_code != HTTPStatus.NOT_FOUND
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user