From 0bd763f8ff02e9b951bcd21d42763bf0b9d30e7b Mon Sep 17 00:00:00 2001 From: jxxghp Date: Sat, 17 Oct 2026 07:42:48 +0800 Subject: [PATCH] fix(types): type dashboard module projections --- app/chain/dashboard.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/chain/dashboard.py b/app/chain/dashboard.py index 1cab794ef..3a188f300 100644 --- a/app/chain/dashboard.py +++ b/app/chain/dashboard.py @@ -1,4 +1,4 @@ -from typing import List, Optional +from typing import List, Optional, cast from app.chain.base import ChainBase from app.schemas.dashboard import DownloaderInfo as _SchemaDownloaderInfo @@ -14,10 +14,16 @@ class DashboardChain(ChainBase): """ 媒体数量统计 """ - return self.run_module("media_statistic", server=server) + return cast( + Optional[List[_SchemaStatistic]], + self.run_module("media_statistic", server=server), + ) def downloader_info(self, downloader: Optional[str] = None) -> Optional[List[_SchemaDownloaderInfo]]: """ 下载器信息 """ - return self.run_module("downloader_info", downloader=downloader) + return cast( + Optional[List[_SchemaDownloaderInfo]], + self.run_module("downloader_info", downloader=downloader), + )