mirror of
https://github.com/d0zingcat/MoviePilot-Plugins.git
synced 2026-05-14 15:09:17 +00:00
修正数字配置值提交为字符串导致的问题。
This commit is contained in:
@@ -650,11 +650,12 @@
|
||||
"name": "插件自动升级",
|
||||
"description": "定时检测、升级插件。",
|
||||
"labels": "自动更新",
|
||||
"version": "1.5",
|
||||
"version": "1.6",
|
||||
"icon": "PluginAutoUpgrade.png",
|
||||
"author": "hotlcc",
|
||||
"level": 1,
|
||||
"history": {
|
||||
"v1.6": "修正数字配置值提交为字符串导致的问题。",
|
||||
"v1.5": "支持配置升级记录最大保存数量和最大展示数量。"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -23,7 +23,7 @@ class PluginAutoUpgrade(_PluginBase):
|
||||
# 插件图标
|
||||
plugin_icon = "PluginAutoUpgrade.png"
|
||||
# 插件版本
|
||||
plugin_version = "1.5"
|
||||
plugin_version = "1.6"
|
||||
# 插件作者
|
||||
plugin_author = "hotlcc"
|
||||
# 作者主页
|
||||
@@ -63,6 +63,8 @@ class PluginAutoUpgrade(_PluginBase):
|
||||
"""
|
||||
初始化插件
|
||||
"""
|
||||
# 修正配置
|
||||
config = self.__fix_config(config=config)
|
||||
# 加载插件配置
|
||||
self.__config = config
|
||||
# 停止现有服务
|
||||
@@ -396,6 +398,19 @@ class PluginAutoUpgrade(_PluginBase):
|
||||
finally:
|
||||
self.__exit_event.clear()
|
||||
|
||||
def __fix_config(self, config: dict) -> dict:
|
||||
"""
|
||||
修正配置
|
||||
"""
|
||||
if not config:
|
||||
config = {}
|
||||
save_record_quantity = config.get("save_record_quantity")
|
||||
config['save_record_quantity'] = int(save_record_quantity) if save_record_quantity else None
|
||||
display_record_quantity = config.get("display_record_quantity")
|
||||
config['display_record_quantity'] = int(display_record_quantity) if display_record_quantity else None
|
||||
self.update_config(config=config)
|
||||
return config
|
||||
|
||||
def __get_config_item(self, config_key: str, use_default: bool = True) -> Any:
|
||||
"""
|
||||
获取插件配置项
|
||||
|
||||
Reference in New Issue
Block a user