Skip to content

Commit 0622d88

Browse files
SoulterDt8333LIghtJUNctionexynos967sourcery-ai[bot]
authored
fix: revert 3106 (#3153)
* fix: revert 3106 Co-authored-by: Dt8333 <25431943+Dt8333@users.noreply.github.com> Co-authored-by: LIghtJUNction <lightjunction.me@gmail.com> Co-authored-by: exynos <110159911+xiaoxi68@users.noreply.github.com> * Update astrbot/dashboard/routes/update.py Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com> * fix: remove unnecessary version file handling in download_dashboard function * fix: revert --------- Co-authored-by: Dt8333 <25431943+Dt8333@users.noreply.github.com> Co-authored-by: LIghtJUNction <lightjunction.me@gmail.com> Co-authored-by: exynos <110159911+xiaoxi68@users.noreply.github.com> Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
1 parent 594f0fe commit 0622d88

File tree

2 files changed

+2
-21
lines changed

2 files changed

+2
-21
lines changed

astrbot/core/utils/io.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,6 @@ async def download_dashboard(
233233
else:
234234
zip_path = Path(path).absolute()
235235

236-
version_file = zip_path.parent / "dist" / "assets" / "version"
237-
238236
if latest or len(str(version)) != 40:
239237
ver_name = "latest" if latest else version
240238
dashboard_release_url = f"https://astrbot-registry.soulter.top/download/astrbot-dashboard/{ver_name}/dist.zip"
@@ -263,12 +261,3 @@ async def download_dashboard(
263261
await download_file(url, str(zip_path), show_progress=True)
264262
with zipfile.ZipFile(zip_path, "r") as z:
265263
z.extractall(extract_path)
266-
267-
if version_file.exists():
268-
return
269-
270-
# 写入dist/version
271-
# https://github.com/AstrBotDevs/AstrBot/pull/3106
272-
# 实际上压根没有dist/version文件,这里需要写入
273-
with version_file.open("w") as f:
274-
f.write(f"{version}")

astrbot/dashboard/routes/update.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,10 @@ async def check_update(self):
5252

5353
try:
5454
dv = await get_dashboard_version()
55-
# WebUI 版本独立于核心版本:不再用 dv 与 v{VERSION} 比较,避免误报
5655
if type_ == "dashboard":
5756
return (
5857
Response()
59-
.ok(
60-
{
61-
"has_new_version": False,
62-
"current_version": dv,
63-
"installed": bool(dv),
64-
}
65-
)
58+
.ok({"has_new_version": dv != f"v{VERSION}", "current_version": dv})
6659
.__dict__
6760
)
6861
else:
@@ -74,8 +67,7 @@ async def check_update(self):
7467
"version": f"v{VERSION}",
7568
"has_new_version": ret is not None,
7669
"dashboard_version": dv,
77-
# dv正常获取则不会提示需要更新
78-
"dashboard_has_new_version": not bool(dv),
70+
"dashboard_has_new_version": bool(dv and dv != f"v{VERSION}"),
7971
},
8072
).__dict__
8173
except Exception as e:

0 commit comments

Comments
 (0)