This commit is contained in:
thsrite
2024-01-03 20:31:52 +08:00
parent 4be2456f18
commit f3bfefc0d6
4 changed files with 17 additions and 10 deletions

View File

@@ -24,5 +24,5 @@ MoviePilot三方插件市场https://github.com/thsrite/MoviePilot-Plugins/
- [订阅提醒 1.1](docs%2FSubscribeReminder.md)
- [Emby观影报告 1.4](docs%2FEmbyReporter.md)
- [豆瓣明星热映订阅 1.2](docs%2FActorSubscribe.md)
- [短剧刮削 1.3](docs%2FShortPlayMonitor.md)
- [短剧刮削 1.4](docs%2FShortPlayMonitor.md)

View File

@@ -2,6 +2,7 @@
### 更新记录
- 1.4 修复转移后路径重命名
- 1.3 智能重命名
- 1.2 修复转移bug
- 1.1 增加排除关键词,立即执行一次
@@ -13,6 +14,7 @@
- compatibility:兼容模式目录同步性能降低且NAS不能休眠但可以兼容挂载的远程共享目录如SMB (建议使用)
是否重命名
- true 自定义识别词
- false
- smart 我看着取

View File

@@ -122,7 +122,7 @@
"ShortPlayMonitor": {
"name": "短剧刮削",
"description": "监控视频短剧创建,刮削。",
"version": "1.3",
"version": "1.4",
"icon": "Amule_B.png",
"author": "thsrite",
"level": 1

View File

@@ -46,7 +46,7 @@ class ShortPlayMonitor(_PluginBase):
# 插件图标
plugin_icon = "Amule_B.png"
# 插件版本
plugin_version = "1.3"
plugin_version = "1.4"
# 插件作者
plugin_author = "thsrite"
# 作者主页
@@ -230,19 +230,24 @@ class ShortPlayMonitor(_PluginBase):
# 硬链接
if isinstance(rename_conf, bool):
if rename_conf:
# 预处理标题
title, _ = WordsMatcher().prepare(Path(target_path).name)
else:
title = Path(target_path).name
target = target_path.replace(dest_dir, "")
parent = Path(Path(target).parents[0])
last = target.replace(str(parent), "")
# 自定义识别次
title, _ = WordsMatcher().prepare(parent)
target_path = Path(dest_dir) / title / last
else:
if str(rename_conf) == "smart":
title = Path(target_path).name.split(".")[0]
target = target_path.replace(dest_dir, "")
parent = Path(Path(target).parents[0])
last = target.replace(str(parent), "")
# 取.第一个
title = Path(parent).name.split(".")[0]
target_path = Path(dest_dir) / title / last
else:
logger.error(f"{target_path} 智能重命名失败")
return
target_path = Path(target_path).parent / title
# 文件夹同步创建
if is_directory:
# 目标文件夹不存在则创建