mirror of
https://github.com/d0zingcat/MoviePilot-Plugins.git
synced 2026-05-13 23:16:47 +00:00
Merge pull request #578 from InfinityPacer/main
This commit is contained in:
@@ -69,11 +69,12 @@
|
||||
"name": "媒体库服务器通知",
|
||||
"description": "发送Emby/Jellyfin/Plex服务器的播放、入库等通知消息。",
|
||||
"labels": "消息通知,媒体库",
|
||||
"version": "1.4",
|
||||
"version": "1.5",
|
||||
"icon": "mediaplay.png",
|
||||
"author": "jxxghp",
|
||||
"level": 1,
|
||||
"history": {
|
||||
"v1.5": "支持独立控制媒体服务器通知",
|
||||
"v1.4": "MoviePilot V2 版本媒体库服务器通知插件"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -18,7 +18,7 @@ class MediaServerMsg(_PluginBase):
|
||||
# 插件图标
|
||||
plugin_icon = "mediaplay.png"
|
||||
# 插件版本
|
||||
plugin_version = "1.4"
|
||||
plugin_version = "1.5"
|
||||
# 插件作者
|
||||
plugin_author = "jxxghp"
|
||||
# 作者主页
|
||||
@@ -92,6 +92,13 @@ class MediaServerMsg(_PluginBase):
|
||||
|
||||
return active_services
|
||||
|
||||
def service_info(self, name: str) -> Optional[ServiceInfo]:
|
||||
"""
|
||||
服务信息
|
||||
"""
|
||||
service_infos = self.service_infos() or {}
|
||||
return service_infos.get(name)
|
||||
|
||||
def get_state(self) -> bool:
|
||||
return self._enabled
|
||||
|
||||
@@ -261,6 +268,18 @@ class MediaServerMsg(_PluginBase):
|
||||
logger.info(f"未开启 {event_info.event} 类型的消息通知")
|
||||
return
|
||||
|
||||
if not self.service_infos():
|
||||
logger.info(f"未开启任一媒体服务器的消息通知")
|
||||
return
|
||||
|
||||
if event_info.server_name and not self.service_info(name=event_info.server_name):
|
||||
logger.info(f"未开启媒体服务器 {event_info.server_name} 的消息通知")
|
||||
return
|
||||
|
||||
if event_info.channel and not self.service_infos(type_filter=event_info.channel):
|
||||
logger.info(f"未开启媒体服务器类型 {event_info.channel} 的消息通知")
|
||||
return
|
||||
|
||||
expiring_key = f"{event_info.item_id}-{event_info.client}-{event_info.user_name}"
|
||||
# 过滤停止播放重复消息
|
||||
if str(event_info.event) == "playback.stop" and expiring_key in self._webhook_msg_keys.keys():
|
||||
|
||||
Reference in New Issue
Block a user