- 修复 normal 方法不生效的问题
This commit is contained in:
EstrellaXD
2022-07-30 11:41:35 +08:00
parent 90a6d8832b
commit 094674aafd
2 changed files with 3 additions and 2 deletions

View File

@@ -86,4 +86,5 @@ class Renamer:
if __name__ == "__main__":
from conf.const_dev import DEV_SETTINGS
settings.init(DEV_SETTINGS)
rename = Renamer(DownloadClient())
rename = Renamer(DownloadClient())
rename.run()

View File

@@ -37,7 +37,7 @@ class DownloadParser:
def rename_normal(self, info: DownloadInfo):
for rule in self.rules:
match_obj = re.match(rule, name, re.I)
match_obj = re.match(rule, info.file_name, re.I)
if match_obj is not None:
title = re.sub(r"([Ss]|Season )\d{1,3}", "", match_obj.group(1)).strip()
new_name = f"{title} S{info.season}E{match_obj.group(2)}{match_obj.group(3)}"