mirror of
https://github.com/thsrite/MoviePilot-Plugins.git
synced 2026-06-06 07:26:47 +00:00
fix 支持联动其他转移插件
This commit is contained in:
@@ -11,7 +11,7 @@ MoviePilot三方插件市场:https://github.com/thsrite/MoviePilot-Plugins/
|
||||
|
||||
- 站点数据统计 1.4 (无未读消息版本)(废弃)
|
||||
- 站点未读消息 1.4
|
||||
- [云盘Strm生成 3.7](docs%2FCloudStrm.md)
|
||||
- [云盘Strm生成 3.8](docs%2FCloudStrm.md)
|
||||
- [Strm文件模式转换 1.0](docs%2FStrmConvert.md)
|
||||
- 清理订阅缓存 1.0
|
||||
- 添加种子下载 1.0
|
||||
|
||||
@@ -2,11 +2,12 @@
|
||||
"CloudStrm": {
|
||||
"name": "云盘Strm生成",
|
||||
"description": "监控文件创建,生成Strm文件。",
|
||||
"version": "3.7",
|
||||
"version": "3.8",
|
||||
"icon": "https://raw.githubusercontent.com/thsrite/MoviePilot-Plugins/main/icons/create.png",
|
||||
"author": "thsrite",
|
||||
"level": 1,
|
||||
"history": {
|
||||
"v3.8": "支持联动其他转移插件",
|
||||
"v3.7": "api模式支持启用https",
|
||||
"v3.6": "支持重建索引周期运行",
|
||||
"v3.4": "交互命令",
|
||||
|
||||
@@ -26,7 +26,7 @@ class CloudStrm(_PluginBase):
|
||||
# 插件图标
|
||||
plugin_icon = "https://raw.githubusercontent.com/thsrite/MoviePilot-Plugins/main/icons/create.png"
|
||||
# 插件版本
|
||||
plugin_version = "3.7"
|
||||
plugin_version = "3.8"
|
||||
# 插件作者
|
||||
plugin_author = "thsrite"
|
||||
# 作者主页
|
||||
@@ -47,6 +47,7 @@ class CloudStrm(_PluginBase):
|
||||
_copy_files = False
|
||||
_rebuild = False
|
||||
_https = False
|
||||
_linkage = False
|
||||
_observer = []
|
||||
_video_formats = ('.mp4', '.avi', '.rmvb', '.wmv', '.mov', '.mkv', '.flv', '.ts', '.webm', '.iso', '.mpg', '.m2ts')
|
||||
__cloud_files_json = "cloud_files.json"
|
||||
@@ -77,6 +78,7 @@ class CloudStrm(_PluginBase):
|
||||
self._onlyonce = config.get("onlyonce")
|
||||
self._rebuild = config.get("rebuild")
|
||||
self._https = config.get("https")
|
||||
self._linkage = config.get("linkage")
|
||||
self._copy_files = config.get("copy_files")
|
||||
self._monitor_confs = config.get("monitor_confs")
|
||||
|
||||
@@ -302,9 +304,23 @@ class CloudStrm(_PluginBase):
|
||||
file.write(json.dumps(self.__cloud_files))
|
||||
file.close()
|
||||
|
||||
@eventmanager.register(EventType.TransferComplete)
|
||||
def _linkage_strm(self, event: Event = None):
|
||||
"""
|
||||
联动生成strm文件
|
||||
"""
|
||||
if self._linkage and event:
|
||||
event_data = event.event_data
|
||||
if not event_data or not event_data.get("transferinfo"):
|
||||
return
|
||||
source_file = event_data.get("transferinfo").path
|
||||
logger.info(f"收到命令,开始处理单个文件 {source_file} ...")
|
||||
if source_file:
|
||||
self.__strm(source_file)
|
||||
|
||||
def __strm(self, source_file):
|
||||
"""
|
||||
判断文件是否有对应strm
|
||||
生成strm文件
|
||||
"""
|
||||
try:
|
||||
# 获取文件的转移路径
|
||||
@@ -430,6 +446,7 @@ class CloudStrm(_PluginBase):
|
||||
"rebuild": self._rebuild,
|
||||
"copy_files": self._copy_files,
|
||||
"https": self._https,
|
||||
"linkage": self._linkage,
|
||||
"cron": self._cron,
|
||||
"monitor_confs": self._monitor_confs
|
||||
})
|
||||
@@ -634,6 +651,22 @@ class CloudStrm(_PluginBase):
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
'component': 'VCol',
|
||||
'props': {
|
||||
'cols': 12,
|
||||
'md': 4
|
||||
},
|
||||
'content': [
|
||||
{
|
||||
'component': 'VSwitch',
|
||||
'props': {
|
||||
'model': 'linkage',
|
||||
'label': '联动其他转移插件',
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -735,6 +768,7 @@ class CloudStrm(_PluginBase):
|
||||
"rebuild": False,
|
||||
"copy_files": False,
|
||||
"https": False,
|
||||
"linkage": False,
|
||||
"monitor_confs": ""
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user