From 0e92e9fc602ff7493a9e082c736b2bb97118fc4c Mon Sep 17 00:00:00 2001 From: thsrite Date: Tue, 17 Oct 2023 15:10:02 +0800 Subject: [PATCH 1/8] =?UTF-8?q?fix=20=E4=BA=A4=E4=BA=92=E9=87=8D=E5=90=AF?= =?UTF-8?q?=E5=AE=8C=E5=8F=91=E9=80=81=E6=B6=88=E6=81=AF=EF=BC=8C=E4=BA=A4?= =?UTF-8?q?=E4=BA=92=E8=8E=B7=E5=8F=96=E5=BD=93=E5=89=8D=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/chain/__init__.py | 9 ++++ app/chain/system.py | 100 +++++++++++++++++++++++++++++++++++++++++- app/command.py | 8 ++++ 3 files changed, 115 insertions(+), 2 deletions(-) diff --git a/app/chain/__init__.py b/app/chain/__init__.py index c63cc00c..ded8ff99 100644 --- a/app/chain/__init__.py +++ b/app/chain/__init__.py @@ -65,6 +65,15 @@ class ChainBase(metaclass=ABCMeta): del cache gc.collect() + @staticmethod + def remove_cache(filename: str) -> None: + """ + 删除本地缓存 + """ + cache_path = settings.TEMP_PATH / filename + if cache_path.exists(): + Path(cache_path).unlink() + def run_module(self, method: str, *args, **kwargs) -> Any: """ 运行包含该方法的所有模块,然后返回结果 diff --git a/app/chain/system.py b/app/chain/system.py index 75c0ab98..0619a6c7 100644 --- a/app/chain/system.py +++ b/app/chain/system.py @@ -1,7 +1,13 @@ +import json +import re +from pathlib import Path from typing import Union from app.chain import ChainBase +from app.core.config import settings +from app.log import logger from app.schemas import Notification, MessageChannel +from app.utils.http import RequestUtils from app.utils.system import SystemUtils @@ -10,6 +16,8 @@ class SystemChain(ChainBase): 系统级处理链 """ + _restart_file = "__system_restart__" + def remote_clear_cache(self, channel: MessageChannel, userid: Union[int, str]): """ 清理系统缓存 @@ -22,6 +30,94 @@ class SystemChain(ChainBase): """ 重启系统 """ - self.post_message(Notification(channel=channel, - title=f"系统正在重启,请耐心等候!", userid=userid)) + if channel and userid: + self.post_message(Notification(channel=channel, + title="系统正在重启,请耐心等候!", userid=userid)) + # 保存重启信息 + self.save_cache({ + "channel": channel.value, + "userid": userid + }, self._restart_file) SystemUtils.restart() + + def version(self, channel: MessageChannel, userid: Union[int, str]): + """ + 查看当前版本、远程版本 + """ + release_version = self.__get_release_version() + local_version = self.__get_local_version() + if release_version == local_version: + title = f"当前版本:{local_version},已是最新版本" + else: + title = f"当前版本:{local_version},远程版本:{release_version}" + + self.post_message(Notification(channel=channel, + title=title, userid=userid)) + + def restart_finish(self): + """ + 如通过交互命令重启, + 重启完发送msg + """ + restart_channel = self.load_cache(self._restart_file) + logger.info(f"获取到重启msg=> {restart_channel}") + if restart_channel: + # 发送重启完成msg + if not isinstance(restart_channel, dict): + restart_channel = json.loads(restart_channel) + + # 版本号 + release_version = self.__get_release_version() + local_version = self.__get_local_version() + if release_version == local_version: + title = f"当前版本:{local_version}" + else: + title = f"当前版本:{local_version},远程版本:{release_version}" + + channel = next( + (channel for channel in MessageChannel.__members__.values() if + channel.value == restart_channel.get('channel')), None) + + self.post_message(Notification(channel=channel, + title=f"系统已重启完成!{title}", + userid=restart_channel.get('userid'))) + self.remove_cache(self._restart_file) + + @staticmethod + def __get_release_version(): + """ + 获取最新版本 + """ + version_res = RequestUtils().get_res( + "https://api.github.com/repos/jxxghp/MoviePilot/releases/latest") + if not version_res: + version_res = RequestUtils(proxies=settings.PROXY).get_res( + "https://api.github.com/repos/jxxghp/MoviePilot/releases/latest") + if version_res: + ver_json = version_res.json() + version = f"{ver_json['tag_name']}" + return version + else: + return None + + @staticmethod + def __get_local_version(): + """ + 查看当前版本 + """ + version_file = Path(__file__).parents[2] / "version.py" + if version_file.exists(): + try: + with open(version_file, 'rb') as f: + version = f.read() + pattern = r"v(\d+\.\d+\.\d+)" + match = re.search(pattern, str(version)) + + if match: + version = match.group(1) + return f"v{version}" + else: + logger.warn("未找到版本号") + return None + except Exception as err: + logger.error(f"加载版本文件 {version_file} 出错:{err}") diff --git a/app/command.py b/app/command.py index e4b5a1f8..5bd730a1 100644 --- a/app/command.py +++ b/app/command.py @@ -142,6 +142,12 @@ class Command(metaclass=Singleton): "description": "重启系统", "category": "管理", "data": {} + }, + "/version": { + "func": SystemChain(self._db).version, + "description": "当前版本", + "category": "管理", + "data": {} } } # 汇总插件命令 @@ -163,6 +169,8 @@ class Command(metaclass=Singleton): self._thread = Thread(target=self.__run) # 启动事件处理线程 self._thread.start() + # 重启msg + SystemChain(self._db).restart_finish() def __run(self): """ From 26f63c4ea73513fca87f77434bca44ad3cca38f7 Mon Sep 17 00:00:00 2001 From: thsrite Date: Tue, 17 Oct 2023 15:12:02 +0800 Subject: [PATCH 2/8] fix --- app/chain/system.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/app/chain/system.py b/app/chain/system.py index 0619a6c7..7b3fe69f 100644 --- a/app/chain/system.py +++ b/app/chain/system.py @@ -1,6 +1,5 @@ import json import re -from pathlib import Path from typing import Union from app.chain import ChainBase @@ -88,11 +87,8 @@ class SystemChain(ChainBase): """ 获取最新版本 """ - version_res = RequestUtils().get_res( + version_res = RequestUtils(proxies=settings.PROXY).get_res( "https://api.github.com/repos/jxxghp/MoviePilot/releases/latest") - if not version_res: - version_res = RequestUtils(proxies=settings.PROXY).get_res( - "https://api.github.com/repos/jxxghp/MoviePilot/releases/latest") if version_res: ver_json = version_res.json() version = f"{ver_json['tag_name']}" @@ -105,7 +101,7 @@ class SystemChain(ChainBase): """ 查看当前版本 """ - version_file = Path(__file__).parents[2] / "version.py" + version_file = settings.ROOT_PATH / "version.py" if version_file.exists(): try: with open(version_file, 'rb') as f: From 8a46ebc4a0de23e5f74d247e923a461e87c80635 Mon Sep 17 00:00:00 2001 From: thsrite Date: Tue, 17 Oct 2023 15:44:26 +0800 Subject: [PATCH 3/8] =?UTF-8?q?fix=20add=20update=E4=BA=A4=E4=BA=92?= =?UTF-8?q?=E5=91=BD=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/chain/system.py | 56 +++++++++++++++++++++++++++++++++++++-------- app/command.py | 6 +++++ 2 files changed, 53 insertions(+), 9 deletions(-) diff --git a/app/chain/system.py b/app/chain/system.py index 7b3fe69f..8930d4c3 100644 --- a/app/chain/system.py +++ b/app/chain/system.py @@ -1,4 +1,5 @@ import json +import os import re from typing import Union @@ -16,6 +17,7 @@ class SystemChain(ChainBase): """ _restart_file = "__system_restart__" + _update_file = "__system_update__" def remote_clear_cache(self, channel: MessageChannel, userid: Union[int, str]): """ @@ -39,6 +41,25 @@ class SystemChain(ChainBase): }, self._restart_file) SystemUtils.restart() + def update(self, channel: MessageChannel, userid: Union[int, str]): + """ + 重启系统 + """ + if channel and userid: + self.post_message(Notification(channel=channel, + title="系统正在更新,请耐心等候!", userid=userid)) + # 保存重启信息 + self.save_cache({ + "channel": channel.value, + "userid": userid + }, self._update_file) + + # 重启系统 + os.system("bash /usr/local/bin/mp_update") + self.post_message(Notification(channel=channel, + title="暂无新版本!", userid=userid)) + self.remove_cache(self._update_file) + def version(self, channel: MessageChannel, userid: Union[int, str]): """ 查看当前版本、远程版本 @@ -58,13 +79,35 @@ class SystemChain(ChainBase): 如通过交互命令重启, 重启完发送msg """ + cache_file, action, channel, userid = None, None, None, None + # 重启消息 restart_channel = self.load_cache(self._restart_file) - logger.info(f"获取到重启msg=> {restart_channel}") if restart_channel: + cache_file = self._restart_file + action = "重启" # 发送重启完成msg if not isinstance(restart_channel, dict): restart_channel = json.loads(restart_channel) + channel = next( + (channel for channel in MessageChannel.__members__.values() if + channel.value == restart_channel.get('channel')), None) + userid = restart_channel.get('userid') + # 更新消息 + update_channel = self.load_cache(self._update_file) + if update_channel: + cache_file = self._update_file + action = "更新" + # 发送重启完成msg + if not isinstance(update_channel, dict): + update_channel = json.loads(update_channel) + channel = next( + (channel for channel in MessageChannel.__members__.values() if + channel.value == update_channel.get('channel')), None) + userid = update_channel.get('userid') + + # 发送消息 + if channel and userid: # 版本号 release_version = self.__get_release_version() local_version = self.__get_local_version() @@ -72,15 +115,10 @@ class SystemChain(ChainBase): title = f"当前版本:{local_version}" else: title = f"当前版本:{local_version},远程版本:{release_version}" - - channel = next( - (channel for channel in MessageChannel.__members__.values() if - channel.value == restart_channel.get('channel')), None) - self.post_message(Notification(channel=channel, - title=f"系统已重启完成!{title}", - userid=restart_channel.get('userid'))) - self.remove_cache(self._restart_file) + title=f"系统已{action}完成!{title}", + userid=userid)) + self.remove_cache(cache_file) @staticmethod def __get_release_version(): diff --git a/app/command.py b/app/command.py index 5bd730a1..34740489 100644 --- a/app/command.py +++ b/app/command.py @@ -148,6 +148,12 @@ class Command(metaclass=Singleton): "description": "当前版本", "category": "管理", "data": {} + }, + "/update": { + "func": SystemChain(self._db).update, + "description": "更新系统", + "category": "管理", + "data": {} } } # 汇总插件命令 From 3aac617f3543e556437dd1589139bf5b6182ac6e Mon Sep 17 00:00:00 2001 From: thsrite Date: Tue, 17 Oct 2023 16:16:17 +0800 Subject: [PATCH 4/8] =?UTF-8?q?feat=20MoviePilot=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E6=8E=A8=E9=80=81=E6=8F=92=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/chain/system.py | 15 +- app/plugins/invitessignin/__init__.py | 2 +- .../moviepilotupdatenotify/__init__.py | 213 ++++++++++++++++++ 3 files changed, 222 insertions(+), 8 deletions(-) create mode 100644 app/plugins/moviepilotupdatenotify/__init__.py diff --git a/app/chain/system.py b/app/chain/system.py index 8930d4c3..2191f570 100644 --- a/app/chain/system.py +++ b/app/chain/system.py @@ -41,7 +41,7 @@ class SystemChain(ChainBase): }, self._restart_file) SystemUtils.restart() - def update(self, channel: MessageChannel, userid: Union[int, str]): + def update(self, channel: MessageChannel = None, userid: Union[int, str] = None): """ 重启系统 """ @@ -56,16 +56,17 @@ class SystemChain(ChainBase): # 重启系统 os.system("bash /usr/local/bin/mp_update") - self.post_message(Notification(channel=channel, - title="暂无新版本!", userid=userid)) - self.remove_cache(self._update_file) + if channel and userid: + self.post_message(Notification(channel=channel, + title="暂无新版本!", userid=userid)) + self.remove_cache(self._update_file) def version(self, channel: MessageChannel, userid: Union[int, str]): """ 查看当前版本、远程版本 """ release_version = self.__get_release_version() - local_version = self.__get_local_version() + local_version = self.get_local_version() if release_version == local_version: title = f"当前版本:{local_version},已是最新版本" else: @@ -110,7 +111,7 @@ class SystemChain(ChainBase): if channel and userid: # 版本号 release_version = self.__get_release_version() - local_version = self.__get_local_version() + local_version = self.get_local_version() if release_version == local_version: title = f"当前版本:{local_version}" else: @@ -135,7 +136,7 @@ class SystemChain(ChainBase): return None @staticmethod - def __get_local_version(): + def get_local_version(): """ 查看当前版本 """ diff --git a/app/plugins/invitessignin/__init__.py b/app/plugins/invitessignin/__init__.py index f8bd39fd..ac6f9511 100644 --- a/app/plugins/invitessignin/__init__.py +++ b/app/plugins/invitessignin/__init__.py @@ -30,7 +30,7 @@ class InvitesSignin(_PluginBase): # 作者主页 author_url = "https://github.com/thsrite" # 插件配置项ID前缀 - plugin_config_prefix = "invitessignin" + plugin_config_prefix = "invitessignin_" # 加载顺序 plugin_order = 24 # 可使用的用户级别 diff --git a/app/plugins/moviepilotupdatenotify/__init__.py b/app/plugins/moviepilotupdatenotify/__init__.py new file mode 100644 index 00000000..214ab7ff --- /dev/null +++ b/app/plugins/moviepilotupdatenotify/__init__.py @@ -0,0 +1,213 @@ +from apscheduler.schedulers.background import BackgroundScheduler +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.log import logger +from app.schemas import NotificationType +from app.utils.http import RequestUtils + + +class MoviePilotUpdateNotify(_PluginBase): + # 插件名称 + plugin_name = "MoviePilot更新推送" + # 插件描述 + plugin_desc = "MoviePilot推送release更新通知、自动更新。" + # 插件图标 + plugin_icon = "update.png" + # 主题色 + plugin_color = "#4179F4" + # 插件版本 + plugin_version = "1.0" + # 插件作者 + plugin_author = "thsrite" + # 作者主页 + author_url = "https://github.com/thsrite" + # 插件配置项ID前缀 + plugin_config_prefix = "moviepilotupdatenotify_" + # 加载顺序 + plugin_order = 25 + # 可使用的用户级别 + auth_level = 1 + + # 私有属性 + _enabled = False + # 任务执行间隔 + _cron = None + _update = False + _notify = False + + # 定时器 + _scheduler: Optional[BackgroundScheduler] = None + + def init_plugin(self, config: dict = None): + # 停止现有任务 + self.stop_service() + + if config: + self._enabled = config.get("enabled") + self._cron = config.get("cron") + self._update = config.get("update") + self._notify = config.get("notify") + + # 加载模块 + if self._enabled: + # 定时服务 + self._scheduler = BackgroundScheduler(timezone=settings.TZ) + + if self._cron: + try: + self._scheduler.add_job(func=self.__check_update, + trigger=CronTrigger.from_crontab(self._cron), + name="检查MoviePilot更新") + except Exception as err: + logger.error(f"定时任务配置错误:{err}") + + # 启动任务 + if self._scheduler.get_jobs(): + self._scheduler.print_jobs() + self._scheduler.start() + + def __check_update(self): + """ + 检查MoviePilot更新 + """ + release_version, description, update_time = self.__get_release_version() + if not release_version: + logger.error("最新版本获取失败,停止运行") + return + + # 本地版本 + local_version = SystemChain().get_local_version() + if release_version == local_version: + logger.info(f"当前版本:{local_version} 远程版本:{release_version} 停止运行") + return + + # 推送更新消息 + if self._notify: + self.post_message( + mtype=NotificationType.SiteMessage, + title="【MoviePilot更新通知】", + text=f"{release_version} \n" + f"\n" + f"{description} \n" + f"{update_time}") + + # 自动更新 + if self._update: + logger.info("开始执行自动更新…") + SystemChain().update() + + @staticmethod + def __get_release_version(): + """ + 获取最新版本 + """ + version_res = RequestUtils(proxies=settings.PROXY).get_res( + "https://api.github.com/repos/jxxghp/MoviePilot/releases/latest") + if version_res: + ver_json = version_res.json() + version = f"{ver_json['tag_name']}" + description = f"{ver_json['body']}" + update_time = f"{ver_json['published_at']}" + return version, description, update_time + else: + return None, None, None + + def get_state(self) -> bool: + return self._enabled + + @staticmethod + def get_command() -> List[Dict[str, Any]]: + pass + + def get_api(self) -> List[Dict[str, Any]]: + pass + + def get_form(self) -> Tuple[List[dict], Dict[str, Any]]: + """ + 拼装插件配置页面,需要返回两块数据:1、页面配置;2、数据结构 + """ + return [ + { + 'component': 'VForm', + 'content': [ + { + 'component': 'VRow', + 'content': [ + { + 'component': 'VCol', + 'props': { + 'cols': 12, + 'md': 4 + }, + 'content': [ + { + 'component': 'VSwitch', + 'props': { + 'model': 'enabled', + 'label': '启用插件', + } + } + ] + }, + { + 'component': 'VCol', + 'props': { + 'cols': 12, + 'md': 4 + }, + 'content': [ + { + 'component': 'VSwitch', + 'props': { + 'model': 'update', + 'label': '自动更新', + } + } + ] + }, + { + 'component': 'VCol', + 'props': { + 'cols': 12, + 'md': 4 + }, + 'content': [ + { + 'component': 'VSwitch', + 'props': { + 'model': 'onlyonce', + 'label': '立即运行一次', + } + } + ] + } + ] + } + ] + } + ], { + "enabled": False, + "update": False, + "notify": False, + "cron": "0 9 * * *" + } + + def get_page(self) -> List[dict]: + pass + + def stop_service(self): + """ + 退出插件 + """ + try: + if self._scheduler: + self._scheduler.remove_all_jobs() + if self._scheduler.running: + self._scheduler.shutdown() + self._scheduler = None + except Exception as e: + logger.error("退出插件失败:%s" % str(e)) From e018f77e3723d59a69474fbc20b0f3a23d823f3a Mon Sep 17 00:00:00 2001 From: thsrite Date: Tue, 17 Oct 2023 16:27:29 +0800 Subject: [PATCH 5/8] fix #895 --- app/modules/qbittorrent/__init__.py | 2 +- app/plugins/mediasyncdel/__init__.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/modules/qbittorrent/__init__.py b/app/modules/qbittorrent/__init__.py index 121a9b74..32ac3403 100644 --- a/app/modules/qbittorrent/__init__.py +++ b/app/modules/qbittorrent/__init__.py @@ -211,7 +211,7 @@ class QbittorrentModule(_ModuleBase): :param hashs: 种子Hash :return: bool """ - return self.qbittorrent.start_torrents(ids=hashs) + return self.qbittorrent.stop_torrents(ids=hashs) def torrent_files(self, tid: str) -> Optional[TorrentFilesList]: """ diff --git a/app/plugins/mediasyncdel/__init__.py b/app/plugins/mediasyncdel/__init__.py index 0ca45f4d..5127d704 100644 --- a/app/plugins/mediasyncdel/__init__.py +++ b/app/plugins/mediasyncdel/__init__.py @@ -969,6 +969,13 @@ class MediaSyncDel(_PluginBase): self.chain.stop_torrents(torrent_hash) handle_cnt += 1 + logger.info(f"暂停转种后下载任务:{download} - {download_id}") + # 删除转种后下载任务 + if download == "transmission": + self.tr.stop_torrents(ids=download_id) + else: + self.qb.stop_torrents(ids=download_id) + handle_cnt += 1 else: # 未转种de情况 if delete_flag: From 4099c5e1b57fb855d61946340c0d12f9897aef1f Mon Sep 17 00:00:00 2001 From: thsrite Date: Tue, 17 Oct 2023 16:43:29 +0800 Subject: [PATCH 6/8] fix --- .../moviepilotupdatenotify/__init__.py | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/app/plugins/moviepilotupdatenotify/__init__.py b/app/plugins/moviepilotupdatenotify/__init__.py index 214ab7ff..b2222ec1 100644 --- a/app/plugins/moviepilotupdatenotify/__init__.py +++ b/app/plugins/moviepilotupdatenotify/__init__.py @@ -179,13 +179,34 @@ class MoviePilotUpdateNotify(_PluginBase): { 'component': 'VSwitch', 'props': { - 'model': 'onlyonce', - 'label': '立即运行一次', + 'model': 'notify', + 'label': '发送通知', } } ] } ] + }, + { + 'component': 'VRow', + 'content': [ + { + 'component': 'VCol', + 'props': { + 'cols': 12, + }, + 'content': [ + { + 'component': 'VTextField', + 'props': { + 'model': 'cron', + 'label': '检查周期', + 'placeholder': '5位cron表达式' + } + } + ] + }, + ] } ] } From 6868712b4e4660ec7688c54b604f7afde966b540 Mon Sep 17 00:00:00 2001 From: thsrite Date: Tue, 17 Oct 2023 16:50:46 +0800 Subject: [PATCH 7/8] =?UTF-8?q?fix=20=E5=85=A5=E5=BA=93=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=E8=BE=93=E5=85=A5=E6=89=8B=E5=8A=A8=E5=A4=84=E7=90=86=E9=80=9A?= =?UTF-8?q?=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/plugins/dirmonitor/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/app/plugins/dirmonitor/__init__.py b/app/plugins/dirmonitor/__init__.py index 4140f840..f0675283 100644 --- a/app/plugins/dirmonitor/__init__.py +++ b/app/plugins/dirmonitor/__init__.py @@ -404,6 +404,7 @@ class DirMonitor(_PluginBase): ) if self._notify: self.chain.post_message(Notification( + mtype=NotificationType.Manual, title=f"{mediainfo.title_year}{file_meta.season_episode} 入库失败!", text=f"原因:{transferinfo.message or '未知'}", image=mediainfo.get_message_image() From b90622a88ea43ea430668613139a374d65a68357 Mon Sep 17 00:00:00 2001 From: thsrite Date: Tue, 17 Oct 2023 16:54:00 +0800 Subject: [PATCH 8/8] fix --- app/chain/system.py | 3 +++ app/plugins/moviepilotupdatenotify/__init__.py | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/chain/system.py b/app/chain/system.py index 2191f570..d18dd402 100644 --- a/app/chain/system.py +++ b/app/chain/system.py @@ -45,6 +45,9 @@ class SystemChain(ChainBase): """ 重启系统 """ + if SystemUtils.is_windows(): + logger.error("windows暂不支持") + return if channel and userid: self.post_message(Notification(channel=channel, title="系统正在更新,请耐心等候!", userid=userid)) diff --git a/app/plugins/moviepilotupdatenotify/__init__.py b/app/plugins/moviepilotupdatenotify/__init__.py index b2222ec1..68f43956 100644 --- a/app/plugins/moviepilotupdatenotify/__init__.py +++ b/app/plugins/moviepilotupdatenotify/__init__.py @@ -80,7 +80,7 @@ class MoviePilotUpdateNotify(_PluginBase): return # 本地版本 - local_version = SystemChain().get_local_version() + local_version = SystemChain(self.db).get_local_version() if release_version == local_version: logger.info(f"当前版本:{local_version} 远程版本:{release_version} 停止运行") return @@ -98,7 +98,7 @@ class MoviePilotUpdateNotify(_PluginBase): # 自动更新 if self._update: logger.info("开始执行自动更新…") - SystemChain().update() + SystemChain(self.db).update() @staticmethod def __get_release_version():