diff --git a/README.md b/README.md index 0d4cb05..316c0b5 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/docs/ShortPlayMonitor.md b/docs/ShortPlayMonitor.md index d618052..cdfcdbf 100644 --- a/docs/ShortPlayMonitor.md +++ b/docs/ShortPlayMonitor.md @@ -2,6 +2,7 @@ ### 更新记录 +- 1.4 修复转移后路径重命名 - 1.3 智能重命名 - 1.2 修复转移bug - 1.1 增加排除关键词,立即执行一次 @@ -13,6 +14,7 @@ - compatibility:兼容模式,目录同步性能降低且NAS不能休眠,但可以兼容挂载的远程共享目录如SMB (建议使用) 是否重命名 + - true 自定义识别词 - false - smart 我看着取 diff --git a/package.json b/package.json index 00d4ce3..25e0005 100644 --- a/package.json +++ b/package.json @@ -122,7 +122,7 @@ "ShortPlayMonitor": { "name": "短剧刮削", "description": "监控视频短剧创建,刮削。", - "version": "1.3", + "version": "1.4", "icon": "Amule_B.png", "author": "thsrite", "level": 1 diff --git a/plugins/shortplaymonitor/__init__.py b/plugins/shortplaymonitor/__init__.py index 5c9ae28..dea937e 100644 --- a/plugins/shortplaymonitor/__init__.py +++ b/plugins/shortplaymonitor/__init__.py @@ -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: # 目标文件夹不存在则创建