From b27f2c43aeac70a0946c009a1fdfc6b356815b72 Mon Sep 17 00:00:00 2001 From: DLmaster361 Date: Thu, 31 Jul 2025 13:50:19 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20MAA=E4=BB=A3=E7=90=86=E6=97=B6=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E6=94=B9=E4=B8=BA=E5=BC=BA=E5=88=B6=E5=BC=80=E5=90=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/core/config.py | 5 +---- app/models/MAA.py | 23 +++-------------------- app/ui/script_manager.py | 9 --------- resources/version.json | 3 ++- 4 files changed, 6 insertions(+), 34 deletions(-) diff --git a/app/core/config.py b/app/core/config.py index 1d5bc2d..779a0c4 100644 --- a/app/core/config.py +++ b/app/core/config.py @@ -359,10 +359,7 @@ class MaaConfig(LQConfig): "RunSet", "RoutineTimeLimit", 10, RangeValidator(1, 1024) ) self.RunSet_AnnihilationWeeklyLimit = ConfigItem( - "RunSet", "AnnihilationWeeklyLimit", False, BoolValidator() - ) - self.RunSet_AutoUpdateMaa = ConfigItem( - "RunSet", "AutoUpdateMaa", False, BoolValidator() + "RunSet", "AnnihilationWeeklyLimit", True, BoolValidator() ) def get_name(self) -> str: diff --git a/app/models/MAA.py b/app/models/MAA.py index f614150..c20e543 100644 --- a/app/models/MAA.py +++ b/app/models/MAA.py @@ -1228,23 +1228,6 @@ class MaaManager(QObject): else: self.update_log_text.emit("".join(self.maa_logs)) - # 获取MAA版本号 - if not self.set["RunSet"]["AutoUpdateMaa"] and not self.maa_version: - - section_match = re.search(r"={35}(.*?)={35}", log, re.DOTALL) - if section_match: - - version_match = re.search( - r"Version\s+v(\d+\.\d+\.\d+(?:-\w+\.\d+)?)", section_match.group(1) - ) - if version_match: - self.maa_version = f"v{version_match.group(1)}" - self.check_maa_version.emit(self.maa_version) - logger.info( - f"检测到MAA版本:{self.maa_version}", - module=f"MAA调度器-{self.name}", - ) - if "自动代理" in self.log_check_mode: # 获取最近一条日志的时间 @@ -1509,9 +1492,9 @@ class MaaManager(QObject): data["Global"][ "VersionUpdate.ScheduledUpdateCheck" ] = "False" # 定时检查更新 - data["Global"]["VersionUpdate.AutoDownloadUpdatePackage"] = str( - self.set["RunSet"]["AutoUpdateMaa"] - ) # 自动下载更新包 + data["Global"][ + "VersionUpdate.AutoDownloadUpdatePackage" + ] = "True" # 自动下载更新包 data["Global"][ "VersionUpdate.AutoInstallUpdatePackage" ] = "False" # 自动安装更新包 diff --git a/app/ui/script_manager.py b/app/ui/script_manager.py index 51578b2..1cafc23 100644 --- a/app/ui/script_manager.py +++ b/app/ui/script_manager.py @@ -913,14 +913,6 @@ class ScriptManager(QWidget): configItem=self.config.RunSet_AnnihilationWeeklyLimit, parent=self, ) - self.card_AutoUpdateMaa = SwitchSettingCard( - icon=FluentIcon.PAGE_RIGHT, - title="自动代理时自动更新MAA", - content="执行自动代理任务时自动更新MAA,关闭后仍会进行MAA版本检查", - qconfig=self.config, - configItem=self.config.RunSet_AutoUpdateMaa, - parent=self, - ) widget = QWidget() Layout = QVBoxLayout(widget) @@ -931,7 +923,6 @@ class ScriptManager(QWidget): Layout.addWidget(self.card_AnnihilationTimeLimit) Layout.addWidget(self.card_RoutineTimeLimit) Layout.addWidget(self.card_AnnihilationWeeklyLimit) - Layout.addWidget(self.card_AutoUpdateMaa) self.viewLayout.setContentsMargins(0, 0, 0, 0) self.viewLayout.setSpacing(0) self.addGroupWidget(widget) diff --git a/resources/version.json b/resources/version.json index e3a97ce..f55ae12 100644 --- a/resources/version.json +++ b/resources/version.json @@ -4,7 +4,8 @@ "4.4.1.5": { "程序优化": [ "优化调度队列配置逻辑", - "优化静默进程标记逻辑,避免未能及时移除导致相关功能持续开启" + "优化静默进程标记逻辑,避免未能及时移除导致相关功能持续开启", + "MAA 代理时更新改为强制开启" ] }, "4.4.1.4": {