From 27b2adef0a261823ac655d2374b458b3a45d5957 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Thu, 10 Oct 2024 15:52:05 +0800 Subject: [PATCH] fix SiteStatistic --- package.v2.json | 4 ++-- plugins.v2/sitestatistic/__init__.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.v2.json b/package.v2.json index 824313a..0c27974 100644 --- a/package.v2.json +++ b/package.v2.json @@ -3,12 +3,12 @@ "name": "站点数据统计", "description": "站点统计数据图表。", "labels": "站点,仪表板", - "version": "1.0.1", + "version": "1.0.2", "icon": "statistic.png", "author": "lightolly,jxxghp", "level": 2, "history": { - "v1.0.1": "MoviePilot V2 版本站点数据统计插件" + "v1.0.2": "MoviePilot V2 版本站点数据统计插件" } }, "BrushFlow": { diff --git a/plugins.v2/sitestatistic/__init__.py b/plugins.v2/sitestatistic/__init__.py index b5a373f..0e29e93 100644 --- a/plugins.v2/sitestatistic/__init__.py +++ b/plugins.v2/sitestatistic/__init__.py @@ -32,7 +32,7 @@ class SiteStatistic(_PluginBase): # 插件图标 plugin_icon = "statistic.png" # 插件版本 - plugin_version = "1.0.1" + plugin_version = "1.0.2" # 插件作者 plugin_author = "lightolly,jxxghp" # 作者主页 @@ -206,8 +206,8 @@ class SiteStatistic(_PluginBase): data_list: List[SiteUserData] = self.siteoper.get_userdata() if not data_list: return "", [], [] - # 每个日期只保留最后一条数据 - data_list = list({data.updated_day: data for data in data_list}.values()) + # 每个日期、每个站点只保留最后一条数据 + data_list = list({f"{data.updated_day}_{data.name}": data for data in data_list}.values()) # 按日期倒序排序 data_list.sort(key=lambda x: x.updated_day, reverse=True) # 今天的日期