fix: Rename 使用非指定的模式可能产生的报错

This commit is contained in:
EstrellaXD
2023-05-20 23:24:24 +08:00
parent 15c9bf3b7a
commit 4b4865ff20
5 changed files with 9 additions and 5 deletions

View File

@@ -15,7 +15,7 @@ jobs:
- name: Generate pull request body
id: pr
run: |
echo "::set-output name=body::$(git log --format='* %s' $(git describe --tags --abbrev=0)..HEAD)"
echo "docs/changelog/${{ github.ref }}.md"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:

View File

@@ -22,8 +22,8 @@
### 通知模块
- 新增 `Bark` 通知模块,可以使用 `Bark` 推送通知到手机。
- 全新的通知方式,现在可以推送海报,番剧名称,更新集数。
- 新增 `Bark` 通知模块.
- 全新的通知方式,现在可以给 Telegram 推送海报,番剧名称,更新集数。
### 数据迁移
@@ -42,4 +42,5 @@
- 加速启动关闭时间
- 重构解析器模块
- 重构重命名模块
- 暂时移除 `normal` 模式
- 增加 `ghcr.io` 镜像

View File

@@ -33,7 +33,7 @@ class Renamer(DownloadClient):
episode = (
f"0{file_info.episode}" if file_info.episode < 10 else file_info.episode
)
if method == "None":
if method == "none" or method == "subtitle_none":
return file_info.media_path
elif method == "pn":
return f"{file_info.title} S{season}E{episode}{file_info.suffix}"
@@ -43,6 +43,9 @@ class Renamer(DownloadClient):
return f"{file_info.title} S{season}E{episode}.{file_info.language}{file_info.suffix}"
elif method == "subtitle_advance":
return f"{bangumi_name} S{season}E{episode}.{file_info.language}{file_info.suffix}"
else:
logger.error(f"Unknown rename method: {method}")
return file_info.media_path
@staticmethod
def send_notification(bangumi_name, ep: EpisodeFile):

View File

@@ -1,4 +1,4 @@
from .rss_analyser import RSSAnalyser
from .analyser import RSSAnalyser
from .add_rules import add_rules