mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-06-03 22:50:01 +08:00
fix api
This commit is contained in:
@@ -147,13 +147,14 @@ class PlexModule(_ModuleBase, _MediaServerBase):
|
||||
media_statistics.append(media_statistic)
|
||||
return media_statistics
|
||||
|
||||
def mediaserver_librarys(self, server: str = None, **kwargs) -> Optional[List[schemas.MediaServerLibrary]]:
|
||||
def mediaserver_librarys(self, server: str = None, hidden: bool = False,
|
||||
**kwargs) -> Optional[List[schemas.MediaServerLibrary]]:
|
||||
"""
|
||||
媒体库列表
|
||||
"""
|
||||
server: Plex = self.get_server(server)
|
||||
if server:
|
||||
return server.get_librarys()
|
||||
return server.get_librarys(hidden)
|
||||
return None
|
||||
|
||||
def mediaserver_items(self, server: str, library_id: str) -> Optional[Generator]:
|
||||
|
||||
@@ -100,7 +100,7 @@ class Plex:
|
||||
return [f"{self._host.rstrip('/') + url}?X-Plex-Token={self._token}" for url in
|
||||
list(poster_urls.keys())[:total_size]]
|
||||
|
||||
def get_librarys(self) -> List[schemas.MediaServerLibrary]:
|
||||
def get_librarys(self, hidden: bool = False) -> List[schemas.MediaServerLibrary]:
|
||||
"""
|
||||
获取媒体服务器所有媒体库列表
|
||||
"""
|
||||
@@ -113,6 +113,8 @@ class Plex:
|
||||
return []
|
||||
libraries = []
|
||||
for library in self._libraries:
|
||||
if hidden and self._sync_libraries and library.key not in self._sync_libraries:
|
||||
continue
|
||||
match library.type:
|
||||
case "movie":
|
||||
library_type = MediaType.MOVIE.value
|
||||
|
||||
Reference in New Issue
Block a user