mirror of
https://github.com/thsrite/MoviePilot-Plugins.git
synced 2026-03-27 10:05:57 +00:00
fix #121
This commit is contained in:
@@ -3,12 +3,13 @@
|
||||
"name": "云盘Strm生成",
|
||||
"description": "监控文件创建,生成Strm文件。",
|
||||
"labels": "云盘",
|
||||
"version": "4.4",
|
||||
"version": "4.4.1",
|
||||
"icon": "https://raw.githubusercontent.com/thsrite/MoviePilot-Plugins/main/icons/create.png",
|
||||
"author": "thsrite",
|
||||
"level": 1,
|
||||
"v2": true,
|
||||
"history": {
|
||||
"v4.4.1": "支持[目录实时监控]插件联动",
|
||||
"v4.4": "修复bug",
|
||||
"v4.3": "回滚自定义媒体类型",
|
||||
"v4.2": "扩展名转小写",
|
||||
@@ -26,12 +27,13 @@
|
||||
"name": "云盘Strm生成(增量版)",
|
||||
"description": "监控文件创建,生成Strm文件(增量版)。",
|
||||
"labels": "云盘",
|
||||
"version": "1.1.2",
|
||||
"version": "1.1.3",
|
||||
"icon": "https://raw.githubusercontent.com/thsrite/MoviePilot-Plugins/main/icons/create.png",
|
||||
"author": "thsrite",
|
||||
"level": 1,
|
||||
"v2": true,
|
||||
"history": {
|
||||
"v1.1.3": "支持[目录实时监控]插件联动",
|
||||
"v1.1.2": "增量文件可选择是否保留",
|
||||
"v1.1.1": "写入strm使用utf-8编码",
|
||||
"v1.1": "某种场景下可能出现卡死,修复bug",
|
||||
|
||||
@@ -370,7 +370,7 @@
|
||||
"author": "thsrite",
|
||||
"level": 1,
|
||||
"history": {
|
||||
"v2.5.2": "支持联动[云盘Strm助手]插件",
|
||||
"v2.5.2": "支持联动[云盘Strm]相关插件",
|
||||
"v2.5.1": "修复媒体刮削",
|
||||
"v2.5": "兼容v2",
|
||||
"v2.4.5": "联动实时软连接插件(近媒体文件)",
|
||||
|
||||
@@ -559,7 +559,7 @@ class CloudLinkMonitor(_PluginBase):
|
||||
# 通知Strm助手生成
|
||||
self.eventmanager.send_event(EventType.PluginAction, {
|
||||
'file_path': str(transferinfo.target_item.path),
|
||||
'action': 'strm_file'
|
||||
'action': 'cloudstrm_file'
|
||||
})
|
||||
|
||||
# 移动模式删除空目录
|
||||
|
||||
@@ -235,7 +235,7 @@ class CloudStrmCompanion(_PluginBase):
|
||||
def strm_one(self, event: Event = None):
|
||||
if event:
|
||||
event_data = event.event_data
|
||||
if not event_data or event_data.get("action") != "strm_file":
|
||||
if not event_data or event_data.get("action") != "cloudstrm_file":
|
||||
return
|
||||
file_path = event_data.get("file_path")
|
||||
if not file_path:
|
||||
|
||||
@@ -26,7 +26,7 @@ class CloudStrm(_PluginBase):
|
||||
# 插件图标
|
||||
plugin_icon = "https://raw.githubusercontent.com/thsrite/MoviePilot-Plugins/main/icons/create.png"
|
||||
# 插件版本
|
||||
plugin_version = "4.4"
|
||||
plugin_version = "4.4.1"
|
||||
# 插件作者
|
||||
plugin_author = "thsrite"
|
||||
# 作者主页
|
||||
@@ -165,6 +165,20 @@ class CloudStrm(_PluginBase):
|
||||
self._scheduler.print_jobs()
|
||||
self._scheduler.start()
|
||||
|
||||
@eventmanager.register(EventType.PluginAction)
|
||||
def cloudstrm_file(self, event: Event = None):
|
||||
if event:
|
||||
event_data = event.event_data
|
||||
if not event_data or event_data.get("action") != "cloudstrm_file":
|
||||
return
|
||||
|
||||
file_path = event_data.get("file_path")
|
||||
if not file_path:
|
||||
logger.error(f"缺少参数:{event_data}")
|
||||
return
|
||||
|
||||
self.__strm(source_file=file_path)
|
||||
|
||||
@eventmanager.register(EventType.PluginAction)
|
||||
def scan(self, event: Event = None):
|
||||
"""
|
||||
|
||||
@@ -3,18 +3,17 @@ import shutil
|
||||
import urllib.parse
|
||||
from datetime import datetime, timedelta
|
||||
from pathlib import Path
|
||||
|
||||
import pytz
|
||||
from typing import Any, List, Dict, Tuple, Optional
|
||||
|
||||
from app.core.event import eventmanager, Event
|
||||
from app.schemas.types import EventType
|
||||
import pytz
|
||||
from apscheduler.schedulers.background import BackgroundScheduler
|
||||
from apscheduler.triggers.cron import CronTrigger
|
||||
|
||||
from app.core.config import settings
|
||||
from app.core.event import eventmanager, Event
|
||||
from app.log import logger
|
||||
from app.plugins import _PluginBase
|
||||
from app.core.config import settings
|
||||
from app.schemas.types import EventType
|
||||
from app.utils.system import SystemUtils
|
||||
|
||||
|
||||
@@ -26,7 +25,7 @@ class CloudStrmIncrement(_PluginBase):
|
||||
# 插件图标
|
||||
plugin_icon = "https://raw.githubusercontent.com/thsrite/MoviePilot-Plugins/main/icons/create.png"
|
||||
# 插件版本
|
||||
plugin_version = "1.1.2"
|
||||
plugin_version = "1.1.3"
|
||||
# 插件作者
|
||||
plugin_author = "thsrite"
|
||||
# 作者主页
|
||||
@@ -164,6 +163,20 @@ class CloudStrmIncrement(_PluginBase):
|
||||
self._scheduler.print_jobs()
|
||||
self._scheduler.start()
|
||||
|
||||
@eventmanager.register(EventType.PluginAction)
|
||||
def cloudstrm_file(self, event: Event = None):
|
||||
if event:
|
||||
event_data = event.event_data
|
||||
if not event_data or event_data.get("action") != "cloudstrm_file":
|
||||
return
|
||||
|
||||
file_path = event_data.get("file_path")
|
||||
if not file_path:
|
||||
logger.error(f"缺少参数:{event_data}")
|
||||
return
|
||||
|
||||
self.__strm(source_file=file_path)
|
||||
|
||||
@eventmanager.register(EventType.PluginAction)
|
||||
def scan(self, event: Event = None):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user