From bf316b42125ef1550af63b946396e6a6c8a5ba13 Mon Sep 17 00:00:00 2001 From: Allen Date: Thu, 16 May 2024 16:01:44 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BA=86=E5=88=9D?= =?UTF-8?q?=E5=A7=8B=E9=85=8D=E7=BD=AE=E5=BB=BA=E8=AE=AE=EF=BC=9B=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E4=BA=86=E9=85=8D=E7=BD=AETracker=E7=9A=84=E5=BC=B9?= =?UTF-8?q?=E7=AA=97=E5=A4=A7=E5=B0=8F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 3 ++- plugins/downloaderhelper/__init__.py | 35 +++++++++++++++++++--------- 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index dec9fe5..5f776c6 100644 --- a/package.json +++ b/package.json @@ -622,11 +622,12 @@ "name": "下载器助手", "description": "自动做种、站点标签、自动删种。", "labels": "下载管理", - "version": "2.0", + "version": "2.1", "icon": "DownloaderHelper.png", "author": "hotlcc", "level": 2, "history": { + "v2.1": "优化了初始配置建议;优化了配置Tracker的弹窗大小。", "v2.0": "优化了仪表板种子状态;提升仪表板对TR的适配度。", "v1.9": "优化了仪表板组件性能。", "v1.8": "新增仪表板活动种子组件,qb完美支持,tr尚未测试,有问题提Issue并@hotlcc", diff --git a/plugins/downloaderhelper/__init__.py b/plugins/downloaderhelper/__init__.py index 1b99444..af5e69e 100644 --- a/plugins/downloaderhelper/__init__.py +++ b/plugins/downloaderhelper/__init__.py @@ -33,7 +33,7 @@ class DownloaderHelper(_PluginBase): # 插件图标 plugin_icon = "DownloaderHelper.png" # 插件版本 - plugin_version = "2.0" + plugin_version = "2.1" # 插件作者 plugin_author = "hotlcc" # 作者主页 @@ -184,7 +184,8 @@ class DownloaderHelper(_PluginBase): 'listen_download_event': True, 'listen_source_file_event': True, 'cron': '0/30 * * * *', - 'exclude_tags': 'BT,刷流' + 'exclude_tags': 'BT,刷流', + 'dashboard_widget_refresh': 5, } # 合并默认配置 config_suggest.update(self.__config_default) @@ -443,7 +444,7 @@ class DownloaderHelper(_PluginBase): 'component': 'VDialog', 'props': { 'model': '_config_tracker_mappings_dialog_closed', - 'max-width': '60rem' + 'max-width': '40rem' }, 'content': [{ 'component': 'VCard', @@ -796,14 +797,26 @@ class DownloaderHelper(_PluginBase): 修正配置 """ if not config: - config = {} - dashboard_widget_size = config.get('dashboard_widget_size') - config['dashboard_widget_size'] = int(dashboard_widget_size) if dashboard_widget_size else None - dashboard_widget_refresh = config.get('dashboard_widget_refresh') - config['dashboard_widget_refresh'] = int(dashboard_widget_refresh) if dashboard_widget_refresh else None - dashboard_widget_display_fields = config.get('dashboard_widget_display_fields') - config['dashboard_widget_display_fields'] = list(filter(lambda field: TorrentFieldMap.get(field), - dashboard_widget_display_fields)) if dashboard_widget_display_fields else [] + return None + # 忽略主程序在reset时赋予的内容 + reset_config = { + "enabled": False, + "enable": False + } + if config == reset_config: + return None + + config_keys = config.keys() + if 'dashboard_widget_size' in config_keys: + dashboard_widget_size = config.get('dashboard_widget_size') + config['dashboard_widget_size'] = int(dashboard_widget_size) if dashboard_widget_size else None + if 'dashboard_widget_refresh' in config_keys: + dashboard_widget_refresh = config.get('dashboard_widget_refresh') + config['dashboard_widget_refresh'] = int(dashboard_widget_refresh) if dashboard_widget_refresh else None + if 'dashboard_widget_display_fields' in config_keys: + dashboard_widget_display_fields = config.get('dashboard_widget_display_fields') + config['dashboard_widget_display_fields'] = list(filter(lambda field: TorrentFieldMap.get(field), + dashboard_widget_display_fields)) if dashboard_widget_display_fields else [] self.update_config(config=config) return config From f2b7930fc1d0a2644d5fecca81ced8de08217131 Mon Sep 17 00:00:00 2001 From: Allen Date: Thu, 16 May 2024 16:02:06 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E4=BB=AA=E8=A1=A8=E6=9D=BF=E5=AD=90=E6=A0=87=E9=A2=98=E8=AF=B4?= =?UTF-8?q?=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 80d13b6..6617f78 100644 --- a/README.md +++ b/README.md @@ -461,6 +461,7 @@ def get_dashboard(self) -> Optional[Tuple[Dict[str, Any], Dict[str, Any], List[d { "refresh": 10, // 自动刷新时间,单位秒 "border": True, // 是否显示边框,默认True,为False时取消组件边框和边距,由插件自行控制 + "subtitle": "子标题", // 组件子标题,缺省时不展示子标题,否则展示为“插件名称 - 子标题” } 3、页面配置使用Vuetify组件拼装,参考:https://vuetifyjs.com/ """