This commit is contained in:
jxxghp
2023-09-28 16:23:10 +08:00
parent e6af2c0f34
commit 02111a3b9f
10 changed files with 42 additions and 6 deletions

View File

@@ -38,6 +38,17 @@ class Plex(metaclass=Singleton):
return False
return True if not self._plex else False
def reconnect(self):
"""
重连
"""
try:
self._plex = PlexServer(self._host, self._token)
self._libraries = self._plex.library.sections()
except Exception as e:
self._plex = None
logger.error(f"Plex服务器连接失败{str(e)}")
def get_librarys(self):
"""
获取媒体服务器所有媒体库列表