mirror of
https://github.com/d0zingcat/MoviePilot-Plugins.git
synced 2026-05-13 23:16:47 +00:00
fix LinkMonitor
This commit is contained in:
@@ -354,7 +354,7 @@
|
|||||||
"LinkMonitor": {
|
"LinkMonitor": {
|
||||||
"name": "实时硬链接",
|
"name": "实时硬链接",
|
||||||
"description": "监控目录文件变化,实时硬链接。",
|
"description": "监控目录文件变化,实时硬链接。",
|
||||||
"version": "1.4",
|
"version": "1.5",
|
||||||
"icon": "Linkace_C.png",
|
"icon": "Linkace_C.png",
|
||||||
"author": "jxxghp",
|
"author": "jxxghp",
|
||||||
"level": 1
|
"level": 1
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ class LinkMonitor(_PluginBase):
|
|||||||
# 插件图标
|
# 插件图标
|
||||||
plugin_icon = "Linkace_C.png"
|
plugin_icon = "Linkace_C.png"
|
||||||
# 插件版本
|
# 插件版本
|
||||||
plugin_version = "1.4"
|
plugin_version = "1.5"
|
||||||
# 插件作者
|
# 插件作者
|
||||||
plugin_author = "jxxghp"
|
plugin_author = "jxxghp"
|
||||||
# 作者主页
|
# 作者主页
|
||||||
@@ -258,8 +258,12 @@ class LinkMonitor(_PluginBase):
|
|||||||
:param target_path: 目标目录
|
:param target_path: 目标目录
|
||||||
:param transfer_type: 转移方式
|
:param transfer_type: 转移方式
|
||||||
"""
|
"""
|
||||||
new_file = str(src_path).replace(mon_path, str(target_path))
|
# 计算相对路径
|
||||||
new_path = Path(new_file)
|
try:
|
||||||
|
rel_path = src_path.relative_to(Path(mon_path))
|
||||||
|
except ValueError:
|
||||||
|
return False, "文件路径不在监控目录内"
|
||||||
|
new_path = target_path / rel_path
|
||||||
if new_path.exists():
|
if new_path.exists():
|
||||||
return True, "目标路径文件已存在"
|
return True, "目标路径文件已存在"
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user