mirror of
https://github.com/d0zingcat/MoviePilot-Plugins.git
synced 2026-05-22 07:26:45 +00:00
Merge pull request #305 from hotlcc/develop-20240516-插件优化
This commit is contained in:
@@ -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/
|
||||
"""
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user