fix SiteStatistic

This commit is contained in:
jxxghp
2025-06-19 11:23:10 +08:00
parent cc7fa1256f
commit 0db1640133
2 changed files with 7 additions and 2 deletions

View File

@@ -3,11 +3,12 @@
"name": "站点数据统计",
"description": "站点统计数据图表。",
"labels": "站点,仪表板",
"version": "1.8",
"version": "1.9",
"icon": "statistic.png",
"author": "lightolly,jxxghp",
"level": 2,
"history": {
"v1.9": "过滤未启用的站点数据",
"v1.8": "修复站点数据增量处理逻辑",
"v1.7.1": "优化内存占用",
"v1.6": "优化了站点数据获取失败时的回退逻辑",

View File

@@ -32,7 +32,7 @@ class SiteStatistic(_PluginBase):
# 插件图标
plugin_icon = "statistic.png"
# 插件版本
plugin_version = "1.8"
plugin_version = "1.9"
# 插件作者
plugin_author = "lightolly,jxxghp"
# 作者主页
@@ -284,6 +284,10 @@ class SiteStatistic(_PluginBase):
if not latest_data:
return "", [], []
# 过滤未启用或不存在的站点
site_domains = [site.domain for site in SiteOper().list_active()]
latest_data = [data for data in latest_data if data and data.domain in site_domains]
# 获取最新日期(用于显示)
latest_day = max(data.updated_day for data in latest_data)