feat:模块健康检查

This commit is contained in:
jxxghp
2024-03-06 13:23:51 +08:00
parent 01e08c8e69
commit 8cb061ff75
24 changed files with 248 additions and 28 deletions

View File

@ -17,6 +17,16 @@ class PlexModule(_ModuleBase):
def stop(self):
pass
def test(self) -> Tuple[bool, str]:
"""
测试模块连接性
"""
if self.plex.is_inactive():
self.plex.reconnect()
if self.plex.is_inactive():
return False, "无法连接Plex请检查参数配置"
return True, ""
def init_setting(self) -> Tuple[str, Union[str, bool]]:
return "MEDIASERVER", "plex"