Skip to content

Commit c173454

Browse files
EstrellaXDclaude
andcommitted
chore: bump version to 3.2.3-beta.3
fix: Episode 0 incorrectly renamed to E01 (#977) fix: NoneType error in match_list when title_raw is null (#976) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 48bf570 commit c173454

File tree

4 files changed

+29
-20
lines changed

4 files changed

+29
-20
lines changed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
# [3.2.3-beta.3] - 2026-01-30
2+
3+
## Backend
4+
5+
### Fixes
6+
7+
- 修复第 0 集被错误重命名为第 1 集的问题 (#977)
8+
- Episode 0 (S01E00) 现在会正确保留,不再被转换为 E01
9+
- 修复聚合 RSS 解析时 `title_raw` 为空导致崩溃的问题 (#976)
10+
- `match_list()` 现在会跳过空的标题,避免 `TypeError`
11+
12+
---
13+
114
# [3.2.3-beta.2] - 2026-01-28
215

316
## Backend

backend/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "auto-bangumi"
3-
version = "3.2.3-beta.2"
3+
version = "3.2.3-beta.3"
44
description = "AutoBangumi - Automated anime download manager"
55
requires-python = ">=3.13"
66
dependencies = [

backend/src/module/database/bangumi.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -389,11 +389,13 @@ def match_list(self, torrent_list: list, rss_link: str) -> list:
389389
# Include both title_raw and all aliases
390390
title_index: dict[str, Bangumi] = {}
391391
for m in match_datas:
392-
# Add main title_raw
393-
title_index[m.title_raw] = m
392+
# Add main title_raw (skip if None to avoid TypeError in sorted())
393+
if m.title_raw:
394+
title_index[m.title_raw] = m
394395
# Add all aliases
395396
for alias in _get_aliases_list(m):
396-
title_index[alias] = m
397+
if alias:
398+
title_index[alias] = m
397399

398400
# Build compiled regex pattern for fast substring matching
399401
# Sort by length descending so longer (more specific) matches are found first

backend/src/module/manager/renamer.py

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -67,20 +67,13 @@ def gen_path(
6767
# Apply episode offset
6868
original_episode = int(file_info.episode)
6969
adjusted_episode = original_episode + episode_offset
70-
if adjusted_episode < 1:
71-
if original_episode < 1:
72-
# Parsed episode is 0 or negative - likely a parsing issue or special episode
73-
# Use episode 1 as fallback to avoid invalid filenames
74-
adjusted_episode = 1
75-
logger.debug(
76-
f"[Renamer] Parsed episode {original_episode} is invalid, using episode 1"
77-
)
78-
else:
79-
# Offset would make episode negative - ignore the offset
80-
adjusted_episode = original_episode
81-
logger.warning(
82-
f"[Renamer] Episode offset {episode_offset} would make episode {original_episode} negative, ignoring offset"
83-
)
70+
# Episode 0 is valid (specials, OVAs, etc.) - only handle truly negative results
71+
if adjusted_episode < 0:
72+
# Offset would make episode negative - ignore the offset
73+
adjusted_episode = original_episode
74+
logger.warning(
75+
f"[Renamer] Episode offset {episode_offset} would make episode {original_episode} negative, ignoring offset"
76+
)
8477
episode = f"0{adjusted_episode}" if adjusted_episode < 10 else adjusted_episode
8578
if method == "none" or method == "subtitle_none":
8679
return file_info.media_path
@@ -148,8 +141,9 @@ async def rename_file(
148141
# Only apply episode offset
149142
original_ep = int(ep.episode)
150143
adjusted_episode = original_ep + episode_offset
151-
if adjusted_episode < 1:
152-
adjusted_episode = 1 if original_ep < 1 else original_ep
144+
# Episode 0 is valid - only handle truly negative results
145+
if adjusted_episode < 0:
146+
adjusted_episode = original_ep
153147
return Notification(
154148
official_title=bangumi_name,
155149
season=ep.season,

0 commit comments

Comments
 (0)