feat(cli): 新增 --rename-only,并把综艺期名尾巴做成改名时保留
- --rename-only:只做重命名,跳过字幕抽取/广告清理/音轨扫描。 整库改名时 auto 模式会顺带抽内嵌 ASS(每个 2 分钟),本次回溯因此中断过一次 - renamer 保留 <规范名>-YYYYMMDD.期名 的尾巴:技术标签变化会重算前缀, 之前会把期名整段丢掉(WEB-DL 里的连字符不能当作分隔符) - 已按新标签回溯全库:动漫电影 117、动漫节目 92、电影 404、电视节目 3309、 综艺 603 条重命名,0 错误、0 冲突副本
This commit is contained in:
@@ -108,12 +108,17 @@ class RenamerService:
|
||||
|
||||
@staticmethod
|
||||
def scan_rename(f_path: Path, target_stem: str, m_type: str, dest_dir: Path, target_season_folder: str, root_dir_path: Path, target_root_folder: str, task_mgr):
|
||||
# 「<目标名>-说明」视为已规范:综艺整理会在技术标签后用「-期名」补充描述,
|
||||
# 综艺命名约定:<规范名>-<YYYYMMDD>.<期名>。技术标签变化时这段说明要保留,
|
||||
# 否则整库整理会把期名抹掉(WEB-DL 里也有连字符,不能简单按 "-" 切)。
|
||||
tail_match = re.search(r"(-\d{8}\..+)$", f_path.stem)
|
||||
tail = tail_match.group(1) if tail_match else ""
|
||||
|
||||
# 「<目标名>-说明」视为已规范:综艺整理会加这段说明,
|
||||
# 整库扫描不应把它当作错名再改回去。
|
||||
if f_path.stem == target_stem or f_path.stem.startswith(f"{target_stem}-"):
|
||||
if f_path.stem == target_stem or f_path.stem == f"{target_stem}{tail}":
|
||||
reserved_new_path = f_path
|
||||
else:
|
||||
new_path = dest_dir / f"{target_stem}{f_path.suffix.lower()}"
|
||||
new_path = dest_dir / f"{target_stem}{tail}{f_path.suffix.lower()}"
|
||||
reserved_new_path = task_mgr.reserve_path(new_path, source_path=f_path)
|
||||
|
||||
if f_path.resolve() != reserved_new_path.resolve():
|
||||
|
||||
Reference in New Issue
Block a user