mirror of
https://github.com/thsrite/MoviePilot-Plugins.git
synced 2026-05-23 07:16:44 +00:00
fix 修复多个任务立即运行一次
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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": "增加执行历史",
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user