This commit is contained in:
jxxghp
2023-08-08 08:05:21 +08:00
parent 15b44c1d13
commit fe89116fcb
2 changed files with 8 additions and 5 deletions

View File

@ -230,10 +230,10 @@ class BestFilmVersion(_PluginBase):
{
'component': 'VAlert',
'props': {
'text': '支持主动定时获取媒体库数据和Webhook两种方式两者只能选一'
'Webhook需要在媒体服务器设置发送Webhook。'
'Plex使用主动获取时建议执行周期设置大1小时'
'收藏Api接口调用Plex官网接口有频率限制。'
'text': '支持主动定时获取媒体库数据和Webhook实时触发两种方式,两者只能选一,'
'Webhook需要在媒体服务器设置发送Webhook报文'
'Plex使用主动获取时建议执行周期设置大1小时'
'收藏Api调用Plex官网接口有频率限制。'
}
}
]

View File

@ -7,6 +7,7 @@ from watchdog.events import FileSystemEventHandler
from watchdog.observers import Observer
from watchdog.observers.polling import PollingObserver
from app.chain.transfer import TransferChain
from app.core.config import settings
from app.core.context import MediaInfo
from app.core.metainfo import MetaInfo
@ -63,6 +64,7 @@ class DirMonitor(_PluginBase):
# 私有属性
transferhis = None
transferchian = None
_observer = []
_enabled = False
_notify = False
@ -75,6 +77,7 @@ class DirMonitor(_PluginBase):
def init_plugin(self, config: dict = None):
self.transferhis = TransferHistoryOper()
self.transferchian = TransferChain()
# 读取配置
if config:
@ -255,7 +258,7 @@ class DirMonitor(_PluginBase):
self.chain.refresh_mediaserver(mediainfo=mediainfo, file_path=transferinfo.target_path)
# 发送通知
if self._notify:
self.chain.send_transfer_message(meta=file_meta, mediainfo=mediainfo, transferinfo=transferinfo)
self.transferchian.send_transfer_message(meta=file_meta, mediainfo=mediainfo, transferinfo=transferinfo)
# 广播事件
self.eventmanager.send_event(EventType.TransferComplete, {
'meta': file_meta,