mirror of
https://github.com/A-Minos/nonebot-plugin-tetris-stats.git
synced 2026-03-05 05:36:54 +08:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| aff2fa120a | |||
| 1c057661c2 | |||
| 83bcd14012 | |||
| 70f53a2c76 |
@@ -241,7 +241,13 @@ class Processor(ProcessorMeta):
|
|||||||
if extra is not None:
|
if extra is not None:
|
||||||
historical_data = list(historical_data)
|
historical_data = list(historical_data)
|
||||||
historical_data.append(extra)
|
historical_data.append(extra)
|
||||||
|
if not historical_data:
|
||||||
|
return [
|
||||||
|
TETRIOInfo.TetraLeagueHistory.Data(record_at=today - forward, tr=user_info.data.user.league.rating),
|
||||||
|
TETRIOInfo.TetraLeagueHistory.Data(
|
||||||
|
record_at=today.replace(microsecond=1000), tr=user_info.data.user.league.rating
|
||||||
|
),
|
||||||
|
]
|
||||||
histories = [
|
histories = [
|
||||||
TETRIOInfo.TetraLeagueHistory.Data(
|
TETRIOInfo.TetraLeagueHistory.Data(
|
||||||
record_at=i.processed_data.user_info.cache.cached_at.astimezone(ZoneInfo('Asia/Shanghai')),
|
record_at=i.processed_data.user_info.cache.cached_at.astimezone(ZoneInfo('Asia/Shanghai')),
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ from fastapi import FastAPI, status
|
|||||||
from fastapi.responses import HTMLResponse
|
from fastapi.responses import HTMLResponse
|
||||||
from fastapi.staticfiles import StaticFiles
|
from fastapi.staticfiles import StaticFiles
|
||||||
from nonebot import get_app, get_driver
|
from nonebot import get_app, get_driver
|
||||||
|
from nonebot.log import logger
|
||||||
from nonebot_plugin_localstore import get_cache_dir # type: ignore[import-untyped]
|
from nonebot_plugin_localstore import get_cache_dir # type: ignore[import-untyped]
|
||||||
from pydantic import IPvAnyAddress
|
from pydantic import IPvAnyAddress
|
||||||
|
|
||||||
@@ -39,11 +40,14 @@ class HostPage:
|
|||||||
self.pages.pop(self.page_hash, None)
|
self.pages.pop(self.page_hash, None)
|
||||||
|
|
||||||
|
|
||||||
app.mount(
|
@driver.on_startup
|
||||||
'/host/assets',
|
def _():
|
||||||
StaticFiles(directory=templates_dir / 'assets'),
|
app.mount(
|
||||||
name='assets',
|
'/host/assets',
|
||||||
)
|
StaticFiles(directory=templates_dir / 'assets'),
|
||||||
|
name='assets',
|
||||||
|
)
|
||||||
|
logger.success('assets mounted')
|
||||||
|
|
||||||
|
|
||||||
@app.get('/host/{page_hash}.html', status_code=status.HTTP_200_OK)
|
@app.get('/host/{page_hash}.html', status_code=status.HTTP_200_OK)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = 'nonebot-plugin-tetris-stats'
|
name = 'nonebot-plugin-tetris-stats'
|
||||||
version = '1.1.0'
|
version = '1.1.2'
|
||||||
description = '一款基于 NoneBot2 的用于查询 Tetris 相关游戏数据的插件'
|
description = '一款基于 NoneBot2 的用于查询 Tetris 相关游戏数据的插件'
|
||||||
authors = ['scdhh <wallfjjd@gmail.com>']
|
authors = ['scdhh <wallfjjd@gmail.com>']
|
||||||
readme = 'README.md'
|
readme = 'README.md'
|
||||||
|
|||||||
Reference in New Issue
Block a user