mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-06-30 00:36:43 +08:00
feat(mediaserver): add item count to media library details across multiple servers
This commit is contained in:
@@ -171,6 +171,7 @@ class Emby:
|
||||
name=library.get("Name"),
|
||||
path=library.get("Path"),
|
||||
type=library_type,
|
||||
item_count=self.get_items_count(library.get("Id")),
|
||||
image=image,
|
||||
link=f'{self._playhost or self._host}web/index.html'
|
||||
f'#!/videos?{server_query}parentId={library.get("Id")}',
|
||||
|
||||
@@ -173,6 +173,7 @@ class Jellyfin:
|
||||
name=library.get("Name"),
|
||||
path=library.get("Path"),
|
||||
type=library_type,
|
||||
item_count=self.get_items_count(library.get("Id")),
|
||||
image=image,
|
||||
link=link,
|
||||
server_type="jellyfin"
|
||||
|
||||
@@ -152,6 +152,7 @@ class Plex:
|
||||
name=library.title,
|
||||
path=library.locations,
|
||||
type=library_type,
|
||||
item_count=self.get_items_count(library.key),
|
||||
image_list=image_list,
|
||||
link=f"{self._playhost or self._host}web/index.html#!/media/{self._plex.machineIdentifier}"
|
||||
f"/com.plexapp.plugins.library?source={library.key}&X-Plex-Token={self._token}",
|
||||
|
||||
@@ -194,6 +194,7 @@ class TrimeMedia:
|
||||
name=library.name,
|
||||
type=library_type,
|
||||
path=library.dir_list,
|
||||
item_count=self.get_items_count(library.guid),
|
||||
image_list=[
|
||||
f"{self._api.host}{img_path}?w=256"
|
||||
for img_path in library.posters or []
|
||||
|
||||
@@ -568,6 +568,7 @@ class Ugreen:
|
||||
name=lib_name,
|
||||
type=library_type,
|
||||
path=lib_path,
|
||||
item_count=lib.get("video_count") or 0,
|
||||
image_list=image_list,
|
||||
link=self.__build_root_url(),
|
||||
server_type="ugreen",
|
||||
|
||||
@@ -248,6 +248,7 @@ class ZSpace:
|
||||
name=library.get("Name"),
|
||||
path=library.get("Path"),
|
||||
type=library_type,
|
||||
item_count=self.get_items_count(library.get("Id")),
|
||||
image=image,
|
||||
link=f'{self._playhost or self._host}web/index.html'
|
||||
f'#!/videos?serverId={self.serverid}&parentId={library.get("Id")}',
|
||||
|
||||
@@ -72,6 +72,8 @@ class MediaServerLibrary(BaseModel):
|
||||
path: Optional[Union[str, list]] = None
|
||||
# 类型
|
||||
type: Optional[str] = None
|
||||
# 媒体库内媒体数量
|
||||
item_count: Optional[int] = None
|
||||
# 封面图
|
||||
image: Optional[str] = None
|
||||
# 封面图列表
|
||||
|
||||
Reference in New Issue
Block a user