From bf316b42125ef1550af63b946396e6a6c8a5ba13 Mon Sep 17 00:00:00 2001 From: Allen Date: Thu, 16 May 2024 16:01:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BA=86=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=BB=BA=E8=AE=AE=EF=BC=9B=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E4=BA=86=E9=85=8D=E7=BD=AETracker=E7=9A=84=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=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