diff --git a/README.md b/README.md index bb391c4..8919107 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,6 @@ MoviePilot三方插件市场:https://github.com/thsrite/MoviePilot-Plugins/ - 源文件恢复 1.2 - [微信消息转发 1.5](docs%2FWeChatForward.md) - 订阅下载统计 1.5 -- [自定义命令 1.3](docs%2FCustomCommand.md) +- [自定义命令 1.5](docs%2FCustomCommand.md) - docker管理 1.1 diff --git a/package.json b/package.json index b5e26ed..caa4519 100644 --- a/package.json +++ b/package.json @@ -263,11 +263,12 @@ "CustomCommand": { "name": "自定义命令", "description": "自定义执行周期执行命令并推送结果。", - "version": "1.4", + "version": "1.5", "icon": "https://raw.githubusercontent.com/thsrite/MoviePilot-Plugins/main/icons/code.png", "author": "thsrite", "level": 1, "history": { + "v1.5": "修复多个任务立即运行一次", "v1.4": "fix icon", "v1.3": "清除历史记录", "v1.2": "增加执行历史", diff --git a/plugins/customcommand/__init__.py b/plugins/customcommand/__init__.py index 891c6bc..6cf279f 100644 --- a/plugins/customcommand/__init__.py +++ b/plugins/customcommand/__init__.py @@ -83,11 +83,6 @@ class CustomCommand(_PluginBase): tz=pytz.timezone(settings.TZ)) + timedelta(seconds=3), name=name, args=[name, command]) - # 关闭一次性开关 - self._onlyonce = False - - # 保存配置 - self.__update_config() else: try: self._scheduler.add_job(func=self.__execute_command, @@ -102,6 +97,11 @@ class CustomCommand(_PluginBase): else: logger.error(f"{time_conf} 配置错误,跳过处理") + if self._onlyonce: + # 关闭一次性开关 + self._onlyonce = False + # 保存配置 + self.__update_config() # 启动任务 if self._scheduler.get_jobs(): self._scheduler.print_jobs()