From f7a441145aa6936b2244f7d95a5e42699e5da637 Mon Sep 17 00:00:00 2001 From: thsrite Date: Sat, 6 Jul 2024 18:36:05 +0800 Subject: [PATCH 1/9] =?UTF-8?q?feat=20=E5=AE=9E=E6=97=B6=E8=BD=AF=E8=BF=9E?= =?UTF-8?q?=E6=8E=A5=20v1.9=20=E4=BA=A4=E4=BA=92=E5=91=BD=E4=BB=A4?= =?UTF-8?q?=E5=AE=9A=E5=90=91=E8=BD=AF=E8=BF=9E=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- package.json | 3 +- plugins/filesoftlink/__init__.py | 83 ++++++++++++++++++++++++-------- 3 files changed, 67 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index da17594..8ce4689 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ MoviePilot三方插件市场:https://github.com/thsrite/MoviePilot-Plugins/ - [自定义命令 v1.7](docs%2FCustomCommand.md) - docker自定义任务 v1.3 - 插件彻底卸载 v1.0 -- 实时软连接 v1.8 +- 实时软连接 v1.9 - 订阅规则自动填充 v2.7 - Emby元数据刷新 v1.3 - Emby媒体标签 v1.2 diff --git a/package.json b/package.json index fda89a2..b479193 100644 --- a/package.json +++ b/package.json @@ -384,11 +384,12 @@ "name": "实时软连接", "description": "监控目录文件变化,媒体文件软连接,其他文件可选复制。", "labels": "文件管理", - "version": "1.8", + "version": "1.9", "icon": "https://raw.githubusercontent.com/thsrite/MoviePilot-Plugins/main/icons/softlink.png", "author": "thsrite", "level": 1, "history": { + "v1.9": "交互命令定向软连接", "v1.8": "修复bug", "v1.6": "bug修复", "v1.5": "优化性能,提高处理速度", diff --git a/plugins/filesoftlink/__init__.py b/plugins/filesoftlink/__init__.py index e75a942..e5eb60f 100644 --- a/plugins/filesoftlink/__init__.py +++ b/plugins/filesoftlink/__init__.py @@ -52,7 +52,7 @@ class FileSoftLink(_PluginBase): # 插件图标 plugin_icon = "https://raw.githubusercontent.com/thsrite/MoviePilot-Plugins/main/icons/softlink.png" # 插件版本 - plugin_version = "1.8" + plugin_version = "1.9" # 插件作者 plugin_author = "thsrite" # 作者主页 @@ -150,15 +150,17 @@ class FileSoftLink(_PluginBase): pass # 异步开启云盘监控 - logger.info(f"异步开启实时硬链接 {mon_path} {self._mode},延迟5s启动") - self._scheduler.add_job(func=self.start_monitor, trigger='date', - run_date=datetime.datetime.now( - tz=pytz.timezone(settings.TZ)) + datetime.timedelta(seconds=5), - name=f"实时硬链接 {mon_path}", - kwargs={ - "source_dir": mon_path - }) - + if str(self._mode) != "nomonitor": + logger.info(f"异步开启实时软连接链接 {mon_path} {self._mode},延迟5s启动") + self._scheduler.add_job(func=self.start_monitor, trigger='date', + run_date=datetime.datetime.now( + tz=pytz.timezone(settings.TZ)) + datetime.timedelta(seconds=5), + name=f"实时硬链接 {mon_path}", + kwargs={ + "source_dir": mon_path + }) + else: + logger.info("实时软链接服务已关闭") # 运行一次定时服务 if self._onlyonce: logger.info("实时软连接服务启动,立即运行一次") @@ -239,6 +241,37 @@ class FileSoftLink(_PluginBase): self.post_message(channel=event.event_data.get("channel"), title="监控目录同步完成!", userid=event.event_data.get("user")) + @eventmanager.register(EventType.PluginAction) + def remote_sync_one(self, event: Event = None): + if event: + event_data = event.event_data + if not event_data or event_data.get("action") != "softlink_one": + return + args = event_data.get("args") + if not args: + return + + # 定向处理文件夹 + # 遍历所有监控目录 + for mon_path in self._dirconf.keys(): + for root, dirs, files in os.walk(mon_path): + for dir_name in dirs: + src_path = os.path.join(root, dir_name) + src_name = Path(src_path).name + logger.info(f"扫描到文件夹 {src_path} {src_name}") + if str(src_name) == str(args): + logger.info(f"开始定向处理文件夹 ...{src_path}") + for sroot, sdirs, sfiles in os.walk(src_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) + break + + if event: + self.post_message(channel=event.event_data.get("channel"), + title=f"{args} 软连接完成!", userid=event.event_data.get("user")) + def sync_all(self): """ 立即运行一次,全量同步目录中所有文件 @@ -358,15 +391,26 @@ class FileSoftLink(_PluginBase): 定义远程控制命令 :return: 命令关键字、事件、描述、附带数据 """ - return [{ - "cmd": "/softlink_sync", - "event": EventType.PluginAction, - "desc": "文件软连接同步", - "category": "", - "data": { - "action": "softlink_sync" + return [ + { + "cmd": "/softlink_sync", + "event": EventType.PluginAction, + "desc": "文件软连接同步", + "category": "", + "data": { + "action": "softlink_sync" + } + }, + { + "cmd": "/soft", + "event": EventType.PluginAction, + "desc": "定向软连接处理", + "category": "", + "data": { + "action": "softlink_one" + } } - }] + ] def get_api(self) -> List[Dict[str, Any]]: return [{ @@ -480,7 +524,8 @@ class FileSoftLink(_PluginBase): 'label': '监控模式', 'items': [ {'title': '兼容模式', 'value': 'compatibility'}, - {'title': '性能模式', 'value': 'fast'} + {'title': '性能模式', 'value': 'fast'}, + {'title': '不监控', 'value': 'nomonitor'}, ] } } From d613c65e8444a4dfbfa1d6fb2b61402164fc8c20 Mon Sep 17 00:00:00 2001 From: thsrite Date: Sat, 6 Jul 2024 18:39:07 +0800 Subject: [PATCH 2/9] fix --- plugins/filesoftlink/__init__.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/plugins/filesoftlink/__init__.py b/plugins/filesoftlink/__init__.py index e5eb60f..32e72e0 100644 --- a/plugins/filesoftlink/__init__.py +++ b/plugins/filesoftlink/__init__.py @@ -258,7 +258,6 @@ class FileSoftLink(_PluginBase): for dir_name in dirs: src_path = os.path.join(root, dir_name) src_name = Path(src_path).name - logger.info(f"扫描到文件夹 {src_path} {src_name}") if str(src_name) == str(args): logger.info(f"开始定向处理文件夹 ...{src_path}") for sroot, sdirs, sfiles in os.walk(src_path): @@ -266,11 +265,10 @@ class FileSoftLink(_PluginBase): 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) - break - - if event: - self.post_message(channel=event.event_data.get("channel"), - title=f"{args} 软连接完成!", userid=event.event_data.get("user")) + if event: + self.post_message(channel=event.event_data.get("channel"), + title=f"{args} 软连接完成!", userid=event.event_data.get("user")) + return def sync_all(self): """ From 57af1f79b7f75f1dbfed7ede5b62523c650719e4 Mon Sep 17 00:00:00 2001 From: thsrite Date: Sat, 6 Jul 2024 18:49:44 +0800 Subject: [PATCH 3/9] =?UTF-8?q?fix=20=E5=A2=9E=E5=BC=BA=E4=BA=A4=E4=BA=92?= =?UTF-8?q?=E5=91=BD=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- package.json | 3 ++- plugins/filesoftlink/__init__.py | 36 ++++++++++++++++++++------------ 3 files changed, 26 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 8ce4689..deefd44 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ MoviePilot三方插件市场:https://github.com/thsrite/MoviePilot-Plugins/ - [自定义命令 v1.7](docs%2FCustomCommand.md) - docker自定义任务 v1.3 - 插件彻底卸载 v1.0 -- 实时软连接 v1.9 +- 实时软连接 v1.9.1 - 订阅规则自动填充 v2.7 - Emby元数据刷新 v1.3 - Emby媒体标签 v1.2 diff --git a/package.json b/package.json index b479193..6c6cf43 100644 --- a/package.json +++ b/package.json @@ -384,11 +384,12 @@ "name": "实时软连接", "description": "监控目录文件变化,媒体文件软连接,其他文件可选复制。", "labels": "文件管理", - "version": "1.9", + "version": "1.9.1", "icon": "https://raw.githubusercontent.com/thsrite/MoviePilot-Plugins/main/icons/softlink.png", "author": "thsrite", "level": 1, "history": { + "v1.9.1": "增强交互命令", "v1.9": "交互命令定向软连接", "v1.8": "修复bug", "v1.6": "bug修复", diff --git a/plugins/filesoftlink/__init__.py b/plugins/filesoftlink/__init__.py index 32e72e0..a5a2da5 100644 --- a/plugins/filesoftlink/__init__.py +++ b/plugins/filesoftlink/__init__.py @@ -52,7 +52,7 @@ class FileSoftLink(_PluginBase): # 插件图标 plugin_icon = "https://raw.githubusercontent.com/thsrite/MoviePilot-Plugins/main/icons/softlink.png" # 插件版本 - plugin_version = "1.9" + plugin_version = "1.9.1" # 插件作者 plugin_author = "thsrite" # 作者主页 @@ -251,24 +251,34 @@ class FileSoftLink(_PluginBase): if not args: return + # 使用正则表达式匹配 + match = re.match(r'(.*?)\s+(.*)', args) + if match: + parent_dir = match.group(1) # 国漫 + args = match.group(2) # 凡人修仙传 (2020) + else: + parent_dir = args + # 定向处理文件夹 # 遍历所有监控目录 for mon_path in self._dirconf.keys(): for root, dirs, files in os.walk(mon_path): for dir_name in dirs: src_path = os.path.join(root, dir_name) - src_name = Path(src_path).name - if str(src_name) == str(args): - logger.info(f"开始定向处理文件夹 ...{src_path}") - for sroot, sdirs, sfiles in os.walk(src_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")) - return + # 定向上级文件夹 + if str(parent_dir) in str(src_path): + src_name = Path(src_path).name + if str(src_name) == str(args): + logger.info(f"开始定向处理文件夹 ...{src_path}") + for sroot, sdirs, sfiles in os.walk(src_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")) + return def sync_all(self): """ From cb1f728b62c34de33544d2f630613ac660cc1ab7 Mon Sep 17 00:00:00 2001 From: thsrite Date: Sat, 6 Jul 2024 18:52:08 +0800 Subject: [PATCH 4/9] fix --- plugins/filesoftlink/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/filesoftlink/__init__.py b/plugins/filesoftlink/__init__.py index a5a2da5..ee79571 100644 --- a/plugins/filesoftlink/__init__.py +++ b/plugins/filesoftlink/__init__.py @@ -359,6 +359,10 @@ class FileSoftLink(_PluginBase): # 查询转移目的目录 target: Path = self._dirconf.get(mon_path) + if not target: + logger.info(f"{mon_path} 没有配置转移目的目录,不处理") + return + target_file = str(file_path).replace(str(mon_path), str(target)) # 如果是文件夹 From 074215903b496d02c115af902f6692953ff9ddf6 Mon Sep 17 00:00:00 2001 From: thsrite Date: Sun, 7 Jul 2024 12:36:11 +0800 Subject: [PATCH 5/9] fix --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index deefd44..d87fac5 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,6 @@ MoviePilot三方插件市场:https://github.com/thsrite/MoviePilot-Plugins/ - 目录监控(统一入库消息增强版) v1.0 - Sql执行器 v1.2 - 命令执行器 v1.2 -- [云盘助手 v2.0.8](docs%2FCloudAssistant.md) - CloudDrive2助手 v1.3 - 软连接重定向 v1.0 - 云盘同步删除 v1.4 From a6d06b7e66d8bed467d94ffa34407bf255a53d2a Mon Sep 17 00:00:00 2001 From: thsrite Date: Sun, 7 Jul 2024 12:36:38 +0800 Subject: [PATCH 6/9] fix --- plugins/filesoftlink/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/filesoftlink/__init__.py b/plugins/filesoftlink/__init__.py index ee79571..28976e8 100644 --- a/plugins/filesoftlink/__init__.py +++ b/plugins/filesoftlink/__init__.py @@ -268,7 +268,7 @@ class FileSoftLink(_PluginBase): # 定向上级文件夹 if str(parent_dir) in str(src_path): src_name = Path(src_path).name - if str(src_name) == str(args): + if str(src_name) in str(args): logger.info(f"开始定向处理文件夹 ...{src_path}") for sroot, sdirs, sfiles in os.walk(src_path): for file_name in sdirs + sfiles: From 8f389683bd4be4a0265db9eb84587e61ee361bab Mon Sep 17 00:00:00 2001 From: thsrite Date: Sun, 7 Jul 2024 12:37:11 +0800 Subject: [PATCH 7/9] fix --- README.md | 2 +- package.json | 3 ++- plugins/filesoftlink/__init__.py | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d87fac5..88eb1fe 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ MoviePilot三方插件市场:https://github.com/thsrite/MoviePilot-Plugins/ - [自定义命令 v1.7](docs%2FCustomCommand.md) - docker自定义任务 v1.3 - 插件彻底卸载 v1.0 -- 实时软连接 v1.9.1 +- 实时软连接 v1.9.2 - 订阅规则自动填充 v2.7 - Emby元数据刷新 v1.3 - Emby媒体标签 v1.2 diff --git a/package.json b/package.json index 6c6cf43..92f5e12 100644 --- a/package.json +++ b/package.json @@ -384,11 +384,12 @@ "name": "实时软连接", "description": "监控目录文件变化,媒体文件软连接,其他文件可选复制。", "labels": "文件管理", - "version": "1.9.1", + "version": "1.9.2", "icon": "https://raw.githubusercontent.com/thsrite/MoviePilot-Plugins/main/icons/softlink.png", "author": "thsrite", "level": 1, "history": { + "v1.9.2": "增强交互命令模糊匹配", "v1.9.1": "增强交互命令", "v1.9": "交互命令定向软连接", "v1.8": "修复bug", diff --git a/plugins/filesoftlink/__init__.py b/plugins/filesoftlink/__init__.py index 28976e8..21a0892 100644 --- a/plugins/filesoftlink/__init__.py +++ b/plugins/filesoftlink/__init__.py @@ -52,7 +52,7 @@ class FileSoftLink(_PluginBase): # 插件图标 plugin_icon = "https://raw.githubusercontent.com/thsrite/MoviePilot-Plugins/main/icons/softlink.png" # 插件版本 - plugin_version = "1.9.1" + plugin_version = "1.9.2" # 插件作者 plugin_author = "thsrite" # 作者主页 From c6bc4662de356a38128d1b1d45f15c9c134dd63c Mon Sep 17 00:00:00 2001 From: thsrite Date: Sun, 7 Jul 2024 12:44:21 +0800 Subject: [PATCH 8/9] fix --- plugins/filesoftlink/__init__.py | 49 ++++++++++++++------------------ 1 file changed, 22 insertions(+), 27 deletions(-) diff --git a/plugins/filesoftlink/__init__.py b/plugins/filesoftlink/__init__.py index 21a0892..e62c412 100644 --- a/plugins/filesoftlink/__init__.py +++ b/plugins/filesoftlink/__init__.py @@ -251,34 +251,29 @@ class FileSoftLink(_PluginBase): if not args: return - # 使用正则表达式匹配 - match = re.match(r'(.*?)\s+(.*)', args) - if match: - parent_dir = match.group(1) # 国漫 - args = match.group(2) # 凡人修仙传 (2020) - else: - parent_dir = args - - # 定向处理文件夹 # 遍历所有监控目录 - for mon_path in self._dirconf.keys(): - for root, dirs, files in os.walk(mon_path): - for dir_name in dirs: - src_path = os.path.join(root, dir_name) - # 定向上级文件夹 - if str(parent_dir) in str(src_path): - src_name = Path(src_path).name - if str(src_name) in str(args): - logger.info(f"开始定向处理文件夹 ...{src_path}") - for sroot, sdirs, sfiles in os.walk(src_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")) - return + mon_path = None + for mon in self._dirconf.keys(): + if str(args).startswith(mon): + mon_path = mon + break + + if not mon_path: + logger.error(f"未获取到 {args} 对应的监控目录") + return + + logger.info(f"获取到 {args} 对应的监控目录 {mon_path}") + + logger.info(f"开始定向处理文件夹 ...{args}") + for sroot, sdirs, sfiles in os.walk(args): + for file_name in sdirs + sfiles: + src_file = os.path.join(sroot, file_name) + if Path(str(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")) + return def sync_all(self): """ From 3f2dedfd93a6d1577cb624cf8dfaf39d6557c12b Mon Sep 17 00:00:00 2001 From: thsrite Date: Sun, 7 Jul 2024 19:37:19 +0800 Subject: [PATCH 9/9] fix --- README.md | 2 +- package.json | 3 +- plugins/filesoftlink/__init__.py | 82 ++++++++++++++++++++++++-------- 3 files changed, 64 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 88eb1fe..168defd 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ MoviePilot三方插件市场:https://github.com/thsrite/MoviePilot-Plugins/ - [自定义命令 v1.7](docs%2FCustomCommand.md) - docker自定义任务 v1.3 - 插件彻底卸载 v1.0 -- 实时软连接 v1.9.2 +- 实时软连接 v1.9.3 - 订阅规则自动填充 v2.7 - Emby元数据刷新 v1.3 - Emby媒体标签 v1.2 diff --git a/package.json b/package.json index 92f5e12..0a6d1d1 100644 --- a/package.json +++ b/package.json @@ -384,11 +384,12 @@ "name": "实时软连接", "description": "监控目录文件变化,媒体文件软连接,其他文件可选复制。", "labels": "文件管理", - "version": "1.9.2", + "version": "1.9.3", "icon": "https://raw.githubusercontent.com/thsrite/MoviePilot-Plugins/main/icons/softlink.png", "author": "thsrite", "level": 1, "history": { + "v1.9.3": "增强交互命令模糊匹配", "v1.9.2": "增强交互命令模糊匹配", "v1.9.1": "增强交互命令", "v1.9": "交互命令定向软连接", diff --git a/plugins/filesoftlink/__init__.py b/plugins/filesoftlink/__init__.py index e62c412..9938ec1 100644 --- a/plugins/filesoftlink/__init__.py +++ b/plugins/filesoftlink/__init__.py @@ -52,7 +52,7 @@ class FileSoftLink(_PluginBase): # 插件图标 plugin_icon = "https://raw.githubusercontent.com/thsrite/MoviePilot-Plugins/main/icons/softlink.png" # 插件版本 - plugin_version = "1.9.2" + plugin_version = "1.9.3" # 插件作者 plugin_author = "thsrite" # 作者主页 @@ -88,6 +88,7 @@ class FileSoftLink(_PluginBase): def init_plugin(self, config: dict = None): # 清空配置 self._dirconf = {} + self._categoryconf = {} # 读取配置 if config: @@ -118,6 +119,11 @@ class FileSoftLink(_PluginBase): if not mon_path: continue + category = None + if mon_path.count("#") == 1: + category = str(mon_path.split("#")[1]).split(",") + mon_path = mon_path.split("#")[0] + # 存储目的目录 if SystemUtils.is_windows(): if mon_path.count(":") > 1: @@ -137,6 +143,8 @@ class FileSoftLink(_PluginBase): else: self._dirconf[mon_path] = None + self._categoryconf[mon_path] = category + # 启用目录监控 if self._enabled: # 检查媒体库目录是不是下载目录的子目录 @@ -251,29 +259,61 @@ class FileSoftLink(_PluginBase): if not args: return - # 遍历所有监控目录 - mon_path = None - for mon in self._dirconf.keys(): - if str(args).startswith(mon): - mon_path = mon - break + # 使用正则表达式匹配 + category = None + args_arr = args.split(maxsplit=1) + if len(args_arr) == 2: + category = args_arr[0] + args = args_arr[1] - if not mon_path: - logger.error(f"未获取到 {args} 对应的监控目录") - return + if category: + for mon_path in self._categoryconf.keys(): + mon_category = self._categoryconf.get(mon_path) + if mon_category and str(category) in mon_category: + parent_path = os.path.join(mon_path, category) + logger.info(f"获取到 {args} 对应的监控目录 {parent_path}") + for root, dirs, files in os.walk(parent_path): + for dir_name in dirs: + src_path = os.path.join(root, dir_name) + # 定向上级文件夹 + src_name = Path(src_path).name + if str(args) in str(src_name): + logger.info(f"开始定向处理文件夹 ...{src_path}") + for sroot, sdirs, sfiles in os.walk(src_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")) + return + return + else: + # 遍历所有监控目录 + mon_path = None + for mon in self._dirconf.keys(): + if str(args).startswith(mon): + mon_path = mon + break - logger.info(f"获取到 {args} 对应的监控目录 {mon_path}") + if mon_path: + if not Path(args).exists(): + logger.info(f"同步路径 {args} 不存在") + return + logger.info(f"获取到 {args} 对应的监控目录 {mon_path}") - logger.info(f"开始定向处理文件夹 ...{args}") - for sroot, sdirs, sfiles in os.walk(args): - for file_name in sdirs + sfiles: - src_file = os.path.join(sroot, file_name) - if Path(str(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")) - return + logger.info(f"开始定向处理文件夹 ...{args}") + for sroot, sdirs, sfiles in os.walk(args): + for file_name in sdirs + sfiles: + src_file = os.path.join(sroot, file_name) + if Path(str(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")) + return def sync_all(self): """