fix(update): 应用内更新只提供同一主版本的发布,准备 3.3.7

4.0 的更新包要求 4.0 镜像,3.3 镜像上无法应用;稳定版与测试版渠道都不再提供 4.x。
发布列表每页取 100 条,4.x 发布增多后仍能找到 3.x 发布。
This commit is contained in:
Estrella Pan
2026-10-24 11:03:45 +02:00
parent ca3cd42105
commit 29dc558789
6 changed files with 37 additions and 4 deletions

View File

@@ -1,3 +1,9 @@
# [3.3.7] - 2026-10-24
3.3.7 只改应用内更新,为 4.0 正式版做准备。
- **变更(应用内更新)**:「软件更新」只提供与当前镜像主版本相同的版本(3.x),稳定版与测试版渠道都是如此。4.0 的更新包要求 4.0 镜像,在 3.3 镜像上无法应用;升级到 4.0 请更换镜像标签,步骤见 [从 3.3 升级到 4.0](https://www.autobangumi.org/deploy/upgrade-4.0)
# [3.3.6] - 2026-09-19
3.3.6 是问题修复版本,修复 3.3.5 发布后报告的 RSS 匹配、网络、解析与部署问题。

View File

@@ -1,6 +1,6 @@
[project]
name = "auto-bangumi"
version = "3.3.6"
version = "3.3.7"
description = "AutoBangumi - Automated anime download manager"
requires-python = ">=3.13"
dependencies = [

View File

@@ -217,7 +217,7 @@ class Updater:
async def _fetch_releases(self) -> list[dict]:
client = await self._get_client()
url = f"{_API_BASE}/repos/{self.owner}/{self.repo}/releases?per_page=20"
url = f"{_API_BASE}/repos/{self.owner}/{self.repo}/releases?per_page=100"
resp = await client.get(url, headers=_API_HEADERS)
resp.raise_for_status()
data = resp.json()
@@ -269,6 +269,9 @@ class Updater:
return bundle_url, sha_url, sig_url
def _pick_release(self, releases: list[dict], channel: str) -> Optional[dict]:
# 只提供与镜像同一主版本的更新:下一个主版本的更新包要求新镜像
# (min_image_version),只能更换镜像标签升级
image = _parse_semver(self.image_version)
candidates: list[tuple[semver.VersionInfo, dict]] = []
for rel in releases:
if rel.get("draft"):
@@ -278,6 +281,8 @@ class Updater:
ver = _parse_semver(rel.get("tag_name") or "")
if ver is None:
continue
if image is not None and ver.major != image.major:
continue
candidates.append((ver, rel))
if not candidates:
return None

View File

@@ -233,6 +233,22 @@ class TestCheckUpdate:
assert res.is_prerelease is True
assert res.has_update is True
@pytest.mark.parametrize(
"channel, expected", [("stable", "3.3.7"), ("beta", "3.3.8-beta.1")]
)
def test_next_major_release_is_not_offered(self, tmp_path, channel, expected):
"""4.x 的更新包要求 4.x 镜像,3.x 镜像只能更换镜像标签升级。"""
releases = [
{"tag_name": tag, "prerelease": "beta" in tag}
for tag in ("4.0.0", "4.0.0-beta.9", "3.3.8-beta.1", "3.3.7")
]
up = Updater(
root=tmp_path / "u", current_version="3.3.6", image_version="3.3.6"
)
picked = up._pick_release(releases, channel)
assert picked is not None
assert picked["tag_name"] == expected
@pytest.mark.asyncio
async def test_no_update_when_current_is_latest(self, tmp_path, bundle):
data, sha = bundle

4
backend/uv.lock generated
View File

@@ -1,5 +1,5 @@
version = 1
revision = 3
revision = 5
requires-python = ">=3.13"
resolution-markers = [
"python_full_version >= '3.15'",
@@ -125,7 +125,7 @@ wheels = [
[[package]]
name = "auto-bangumi"
version = "3.3.6"
version = "3.3.7"
source = { virtual = "." }
dependencies = [
{ name = "aiosqlite" },

View File

@@ -2,6 +2,12 @@
3.3 is the largest AutoBangumi release in a while: a fully async backend architecture, aria2 promoted to a first-class download backend, movie/OVA/special support, per-bangumi release preferences, a hardened security stack, and a WebUI that updates over SSE instead of polling. REST API behavior is backward-compatible; existing databases upgrade automatically through schema v24.
## 3.3.7 — In-app update stays on 3.x
3.3.7 changes only the in-app update, to prepare for the 4.0 stable release.
- **In-app update:** Software Update now offers only versions with the same major version as the image (3.x), on the stable and the beta channel. A 4.0 update bundle needs a 4.0 image and cannot be applied on a 3.3 image. To upgrade to 4.0, change the image tag. See [Upgrade from 3.3 to 4.0](https://www.autobangumi.org/en/deploy/upgrade-4.0).
## 3.3.6 — RSS matching, proxy, parser, and deployment fixes
3.3.6 is a bugfix release for issues reported after 3.3.5.