fix 云盘实时链接可配置是否刮削

This commit is contained in:
thsrite
2024-04-15 09:39:52 +08:00
parent ad337f6d17
commit 612cc3836f
3 changed files with 25 additions and 8 deletions

View File

@@ -25,7 +25,7 @@ MoviePilot三方插件市场https://github.com/thsrite/MoviePilot-Plugins/
- [Emby观影报告 1.5](docs%2FEmbyReporter.md)
- 演员订阅 1.5
- [短剧刮削 3.2](docs%2FShortPlayMonitor.md)
- 云盘实时链接 1.5
- 云盘实时链接 1.6
- 源文件恢复 1.2
- [微信消息转发 1.5](docs%2FWeChatForward.md)
- 订阅下载统计 1.5

View File

@@ -201,12 +201,13 @@
},
"CloudLinkMonitor": {
"name": "云盘实时链接",
"description": "监控云盘目录文件变化,自动转移链接(不刮削)。",
"version": "1.5",
"description": "监控云盘目录文件变化,自动转移链接。",
"version": "1.6",
"icon": "Linkease_A.png",
"author": "thsrite",
"level": 1,
"history": {
"v1.6": "可配置是否刮削",
"v1.5": "fix 消息推送",
"v1.4": "fix 转移后路径",
"v1.3": "修复bug",

View File

@@ -56,11 +56,11 @@ class CloudLinkMonitor(_PluginBase):
# 插件名称
plugin_name = "云盘实时链接"
# 插件描述
plugin_desc = "监控云盘目录文件变化,自动转移链接(不刮削不生成目的二级目录)"
plugin_desc = "监控云盘目录文件变化,自动转移链接。"
# 插件图标
plugin_icon = "Linkease_A.png"
# 插件版本
plugin_version = "1.5"
plugin_version = "1.6"
# 插件作者
plugin_author = "thsrite"
# 作者主页
@@ -109,6 +109,7 @@ class CloudLinkMonitor(_PluginBase):
# 清空配置
self._dirconf = {}
self._transferconf = {}
self._scraperconf = {}
# 读取配置
if config:
@@ -141,6 +142,12 @@ class CloudLinkMonitor(_PluginBase):
if not mon_path:
continue
# 是否刮削
_scraper_type = False
if mon_path.count("$") == 1:
_scraper_type = bool(mon_path.split("$")[1])
mon_path = mon_path.split("$")[0]
# 自定义转移方式
_transfer_type = self._transfer_type
if mon_path.count("#") == 1:
@@ -166,6 +173,9 @@ class CloudLinkMonitor(_PluginBase):
else:
self._dirconf[mon_path] = None
# 是否刮削
self._scraperconf[mon_path] = _scraper_type
# 转移方式
self._transferconf[mon_path] = _transfer_type
@@ -331,9 +341,7 @@ class CloudLinkMonitor(_PluginBase):
return
# 判断是不是蓝光目录
bluray_flag = False
if re.search(r"BDMV[/\\]STREAM", event_path, re.IGNORECASE):
bluray_flag = True
# 截取BDMV前面的路径
blurray_dir = event_path[:event_path.find("BDMV")]
file_path = Path(blurray_dir)
@@ -359,6 +367,8 @@ class CloudLinkMonitor(_PluginBase):
target: Path = self._dirconf.get(mon_path)
# 查询转移方式
transfer_type = self._transferconf.get(mon_path)
# 是否刮削
scraper_type = self._scraperconf.get(mon_path)
# 识别媒体信息
mediainfo: MediaInfo = self.chain.recognize_media(meta=file_meta)
@@ -386,6 +396,10 @@ class CloudLinkMonitor(_PluginBase):
mediainfo.title = transfer_history.title
logger.info(f"{file_path.name} 识别为:{mediainfo.type.value} {mediainfo.title_year}")
if scraper_type:
# 更新媒体图片
self.chain.obtain_images(mediainfo=mediainfo)
# 获取集数据
if mediainfo.type == MediaType.TV:
episodes_info = self.tmdbchain.tmdb_episodes(tmdbid=mediainfo.tmdb_id,
@@ -854,7 +868,9 @@ class CloudLinkMonitor(_PluginBase):
'rows': 5,
'placeholder': '每一行一个目录,支持以下几种配置方式,转移方式支持 move、copy、link、softlink、rclone_copy、rclone_move\n'
'监控目录:转移目的目录\n'
'监控目录:转移目的目录#转移方式'
'监控目录:转移目的目录$是否刮削True/False\n'
'监控目录:转移目的目录#转移方式\n'
'监控目录:转移目的目录#转移方式$是否刮削True/False\n'
}
}
]