jxxghp
2025-05-28 20:01:26 +08:00
parent 2817e6c9db
commit 637cf9e83a
2 changed files with 8 additions and 7 deletions

View File

@@ -345,11 +345,12 @@
"name": "MoviePilot更新推送",
"description": "MoviePilot推送release更新通知、自动重启。",
"labels": "消息通知,自动更新",
"version": "2.1",
"version": "2.2",
"icon": "Moviepilot_A.png",
"author": "thsrite",
"level": 1,
"history": {
"v2.2": "支持 MoviePilot v2.5.0+",
"v2.1": "优化执行周期输入需要MoviePilot v2.2.1+",
"v2.0": "兼容MoviePilot V2"
}

View File

@@ -1,5 +1,6 @@
import datetime
import re
from typing import Any, List, Dict, Tuple, Optional
import pytz
from apscheduler.schedulers.background import BackgroundScheduler
@@ -7,12 +8,11 @@ from apscheduler.triggers.cron import CronTrigger
from app.chain.system import SystemChain
from app.core.config import settings
from app.plugins import _PluginBase
from typing import Any, List, Dict, Tuple, Optional
from app.helper.system import SystemHelper
from app.log import logger
from app.plugins import _PluginBase
from app.schemas import NotificationType
from app.utils.http import RequestUtils
from app.utils.system import SystemUtils
class MoviePilotUpdateNotify(_PluginBase):
@@ -23,7 +23,7 @@ class MoviePilotUpdateNotify(_PluginBase):
# 插件图标
plugin_icon = "Moviepilot_A.png"
# 插件版本
plugin_version = "2.1"
plugin_version = "2.2"
# 插件作者
plugin_author = "thsrite"
# 作者主页
@@ -70,7 +70,7 @@ class MoviePilotUpdateNotify(_PluginBase):
# 自动重启
if (server_update or front_update) and self._restart:
logger.info("开始执行自动重启…")
SystemUtils.restart()
SystemHelper.restart()
def __check_server_update(self):
"""
@@ -165,7 +165,7 @@ class MoviePilotUpdateNotify(_PluginBase):
logger.error("无法获取版本信息请检查网络连接或GitHub API请求。")
return None
def __get_backend_latest(self) -> Tuple[str, str, str]:
def __get_backend_latest(self) -> Tuple[Optional[str], Optional[str], Optional[str]]:
"""
获取最新版本
"""