Skip to content

fix: 修复聚合RSS崩溃、空过滤器误杀种子、添加OneBot v11通知支持等#1032

Closed
AMYdd00 wants to merge 8 commits into
EstrellaXD:mainfrom
AMYdd00:pr/upstream
Closed

fix: 修复聚合RSS崩溃、空过滤器误杀种子、添加OneBot v11通知支持等#1032
AMYdd00 wants to merge 8 commits into
EstrellaXD:mainfrom
AMYdd00:pr/upstream

Conversation

@AMYdd00
Copy link
Copy Markdown

@AMYdd00 AMYdd00 commented May 1, 2026

概述

本 PR 包含多个修复和新功能,主要解决 AutoBangumi 3.2.x 版本中的几个关键问题,并新增 OneBot v11 (QQ) 通知推送支持。


🐛 Bug 修复

1. 修复聚合 RSS KeyError 崩溃

文件: backend/src/module/database/bangumi.py

match_list 方法中,当 title_index 为空时,re.compile("") 会匹配任意字符串,导致后续逻辑出现 KeyError。添加了空值保护,提前返回所有 torrent 作为未匹配项。

2. 修复空过滤器误杀全部种子

文件: backend/src/module/network/request_contents.py

filter 配置为空列表时,"|".join([]) 得到空字符串 ""re.search("", x) 永远返回匹配成功,导致所有种子被过滤掉。修复后,空过滤器直接跳过正则匹配,保留所有种子。

3. 修复 webui/types/config.ts 中文注释乱码

文件: webui/types/config.ts

修复了中文注释在编码转换过程中出现的乱码问题。


✨ 新功能

4. 新增 OneBot v11 (QQ) 通知推送支持

新增文件:

  • backend/src/module/notification/providers/onebot.py

修改文件:

  • backend/src/module/notification/__init__.py
  • backend/src/module/models/config.py
  • backend/src/module/api/notification.py
  • webui/src/api/notification.ts
  • webui/src/components/setting/config-notification.vue
  • webui/types/config.ts
  • backend/src/test/test_notification.py

支持通过 OneBot v11 协议(兼容 LLOneBot、go-cqhttp、Lagrange.OneBot 等)发送番剧更新通知到 QQ。

配置字段:

  • url: OneBot HTTP API 地址
  • token: 可选 access_token
  • chat_id: 目标 QQ 号或群号
  • message_type: private(私聊)或 group(群聊)

海报图片支持: 自动处理本地海报文件,读取后转为 base64 格式发送,确保 OneBot 能正常显示。

5. 下载路径自动转换 Windows/Linux 路径

文件: backend/src/module/core/program.py

在 Windows 和 Linux 双平台下自动转换下载路径格式,解决跨平台路径分隔符不兼容问题。


🔧 其他改进

6. 默认端口改为 37892

文件: backend/src/module/conf/const.py

将默认 WebUI 端口从 7892 改为 37892,避免与其他常见服务端口冲突。

7. 添加版本号文件

文件: backend/src/module/__version__.py(新增)

添加版本文件,避免 DEV 模式跳转到 FastAPI 文档页面。


文件变更清单

文件 变更
backend/src/module/database/bangumi.py 修复聚合 RSS KeyError
backend/src/module/network/request_contents.py 修复空过滤器误杀
backend/src/module/notification/providers/onebot.py 新增 OneBot 通知
backend/src/module/notification/__init__.py 注册 OneBot provider
backend/src/module/models/config.py 添加 OneBot 配置字段
backend/src/module/api/notification.py 支持 OneBot 配置
backend/src/module/conf/const.py 默认端口 37892
backend/src/module/__version__.py 新增 版本号
backend/src/module/core/program.py 路径转换
backend/src/test/test_notification.py OneBot 测试
webui/types/config.ts 修复乱码 + OneBot 类型
webui/src/api/notification.ts OneBot API 支持
webui/src/components/setting/config-notification.vue OneBot UI 配置
.gitignore 取消忽略 __version__.py

AMYdd00 added 8 commits May 1, 2026 21:29
修复内容:
- match_list 空 title_index 保护 (bangumi.py)
- 过滤器空值保护 (request_contents.py)
- entrypoint.sh CRLF 换行符修复
- 默认端口 7892 -> 37892
- 添加 __version__.py 版本号文件
- Dockerfile 改为全使用 ghcr.io 镜像,加入前端编译产物
- 后端 /status API 新增 platform 字段,返回 linux/windows
- 前端下载器设置页显示当前平台标识
- 添加「路径转换」按钮,一键在 /downloads/ 和 D:\ 之间切换
- Add OneBotProvider for sending notifications via OneBot v11 HTTP API
- Support both private and group messages
- Support poster image attachment
- Add message_type config field (private/group)
- Register OneBotProvider in provider registry
- Add frontend UI for OneBot configuration
- Add API endpoint support for message_type field
- Add unit tests for OneBotProvider
@vercel
Copy link
Copy Markdown

vercel Bot commented May 1, 2026

@AMYdd00 is attempting to deploy a commit to the estrellaxd's projects Team on Vercel.

A member of the Team first needs to authorize it.

@AMYdd00 AMYdd00 closed this May 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant