mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-04-13 11:39:50 +08:00
fix module close
This commit is contained in:
@@ -45,7 +45,12 @@ class PlexModule(_ModuleBase, _MediaServerBase[Plex]):
|
||||
return 3
|
||||
|
||||
def stop(self):
|
||||
pass
|
||||
"""
|
||||
停止模块服务
|
||||
"""
|
||||
for server in self.get_instances().values():
|
||||
if server:
|
||||
server.close()
|
||||
|
||||
def test(self) -> Optional[Tuple[bool, str]]:
|
||||
"""
|
||||
@@ -273,7 +278,8 @@ class PlexModule(_ModuleBase, _MediaServerBase[Plex]):
|
||||
episodes=episodes
|
||||
) for season, episodes in seasoninfo.items()]
|
||||
|
||||
def mediaserver_playing(self, server: str, count: Optional[int] = 20, **kwargs) -> List[schemas.MediaServerPlayItem]:
|
||||
def mediaserver_playing(self, server: str, count: Optional[int] = 20, **kwargs) -> List[
|
||||
schemas.MediaServerPlayItem]:
|
||||
"""
|
||||
获取媒体服务器正在播放信息
|
||||
"""
|
||||
|
||||
@@ -14,7 +14,7 @@ from app.log import logger
|
||||
from app.schemas import MediaType
|
||||
from app.utils.http import RequestUtils
|
||||
from app.utils.url import UrlUtils
|
||||
from schemas import MediaServerItem
|
||||
from app.schemas import MediaServerItem
|
||||
|
||||
|
||||
class Plex:
|
||||
@@ -890,3 +890,7 @@ class Plex:
|
||||
session = Session()
|
||||
session.headers = headers
|
||||
return session
|
||||
|
||||
def close(self):
|
||||
if self._session:
|
||||
self._session.close()
|
||||
|
||||
Reference in New Issue
Block a user