Skip to content

[Bug] rename_method=none 时下载完成通知不发送 #1082

Description

@km191

确认

  • 我的版本是最新版本,我的版本号与 version 相同。
  • 我已经查阅了已知问题,并确认我的问题不在其中。
  • 我已经 issue 中搜索过,确认我的问题没有被提出过。
  • 我已经修改标题,将标题中的 描述 替换为我遇到的问题。

当前程序版本

3.3.4

问题类型

其他问题

问题描述

现象

故障消息(RSS异常、下载器连接异常等)能正常通过 Telegram 发送,但下载完成通知永远不会发送。

环境

  • rename_method: none
  • 通知方式: Telegram
  • Docker 部署

根因

_execute_media_rename() 方法中,当 source_path == target_path 时返回 ALREADY_APPLIED 但没有附带 Notification

if prepared.source_path == prepared.target_path:
return MediaRenameReport(
result=RenameResult(RenameOutcome.ALREADY_APPLIED),
prepared=prepared,
# ← notification 缺失
)

当 rename_method=none 时,gen_path() 返回原始路径,source_path == target_path 永远为 True,导致 send_all() 永远不会被调用。

修复

在 ALREADY_APPLIED 分支补充 Notification:

if prepared.source_path == prepared.target_path:
return MediaRenameReport(
result=RenameResult(RenameOutcome.ALREADY_APPLIED),
prepared=prepared,
notification=Notification(
official_title=bangumi_name,
season=prepared.episode.season,
episode=self._adjust_episode(prepared.episode.episode, episode_offset),
),
)

发生问题时系统日志

# 修复前:没有任何 notification 相关日志,Rename process finished 后 silent
[2026-07-16 02:24:26] DEBUG: module.manager.renamer: Rename process finished.

# 修复后:通知成功发送
[2026-07-16 02:26:31] DEBUG: module.notification.providers.telegram: Telegram notification: 200
[2026-07-16 02:26:31] DEBUG: module.notification.manager: Sent notification via TelegramProvider: BanG Dream!梦想妄想世界

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions