fix 增强交互命令

This commit is contained in:
thsrite
2024-07-09 11:38:36 +08:00
parent b9b82bd260
commit 544057f7e2
3 changed files with 21 additions and 3 deletions

View File

@@ -33,7 +33,7 @@ MoviePilot三方插件市场https://github.com/thsrite/MoviePilot-Plugins/
- [自定义命令 v1.7](docs%2FCustomCommand.md)
- docker自定义任务 v1.3
- 插件彻底卸载 v1.0
- 实时软连接 v1.9.4
- 实时软连接 v1.9.5
- 订阅规则自动填充 v2.7
- Emby元数据刷新 v1.3
- Emby媒体标签 v1.2

View File

@@ -388,11 +388,12 @@
"name": "实时软连接",
"description": "监控目录文件变化,媒体文件软连接,其他文件可选复制。",
"labels": "文件管理",
"version": "1.9.4",
"version": "1.9.5",
"icon": "https://raw.githubusercontent.com/thsrite/MoviePilot-Plugins/main/icons/softlink.png",
"author": "thsrite",
"level": 1,
"history": {
"v1.9.5": "增强交互命令",
"v1.9.4": "监控目录自定义监控模式",
"v1.9.3": "增强交互命令模糊匹配",
"v1.9.2": "增强交互命令模糊匹配",

View File

@@ -52,7 +52,7 @@ class FileSoftLink(_PluginBase):
# 插件图标
plugin_icon = "https://raw.githubusercontent.com/thsrite/MoviePilot-Plugins/main/icons/softlink.png"
# 插件版本
plugin_version = "1.9.4"
plugin_version = "1.9.5"
# 插件作者
plugin_author = "thsrite"
# 作者主页
@@ -306,6 +306,7 @@ class FileSoftLink(_PluginBase):
mon_path = mon
break
# 指定路径软连接
if mon_path:
if not Path(args).exists():
logger.info(f"同步路径 {args} 不存在")
@@ -322,6 +323,22 @@ class FileSoftLink(_PluginBase):
self.post_message(channel=event.event_data.get("channel"),
title=f"{args} 软连接完成!", userid=event.event_data.get("user"))
return
else:
for mon_path in self._categoryconf.keys():
mon_category = self._categoryconf.get(mon_path)
logger.info(f"开始检查 {mon_path} {mon_category}")
if mon_category and str(args) in mon_category:
parent_path = os.path.join(mon_path, args)
logger.info(f"获取到 {args} 对应的监控目录 {parent_path}")
for sroot, sdirs, sfiles in os.walk(parent_path):
for file_name in sdirs + sfiles:
src_file = os.path.join(sroot, file_name)
if Path(src_file).is_file():
self.__handle_file(event_path=str(src_file), mon_path=mon_path)
if event:
self.post_message(channel=event.event_data.get("channel"),
title=f"{args} 软连接完成!",
userid=event.event_data.get("user"))
def sync_all(self):
"""