mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-05-11 18:10:15 +08:00
add server_type return
This commit is contained in:
@@ -166,7 +166,8 @@ class Emby:
|
||||
type=library_type,
|
||||
image=image,
|
||||
link=f'{self._playhost or self._host}web/index.html'
|
||||
f'#!/videos?serverId={self.serverid}&parentId={library.get("Id")}'
|
||||
f'#!/videos?serverId={self.serverid}&parentId={library.get("Id")}',
|
||||
server_type= "emby"
|
||||
)
|
||||
)
|
||||
return libraries
|
||||
@@ -1167,7 +1168,8 @@ class Emby:
|
||||
type=item_type,
|
||||
image=image,
|
||||
link=link,
|
||||
percent=item.get("UserData", {}).get("PlayedPercentage")
|
||||
percent=item.get("UserData", {}).get("PlayedPercentage"),
|
||||
server_type='emby'
|
||||
))
|
||||
return ret_resume
|
||||
else:
|
||||
@@ -1219,7 +1221,8 @@ class Emby:
|
||||
type=item_type,
|
||||
image=image,
|
||||
link=link,
|
||||
BackdropImageTags=item.get("BackdropImageTags")
|
||||
BackdropImageTags=item.get("BackdropImageTags"),
|
||||
server_type='emby'
|
||||
))
|
||||
return ret_latest
|
||||
else:
|
||||
|
||||
@@ -168,7 +168,8 @@ class Jellyfin:
|
||||
path=library.get("Path"),
|
||||
type=library_type,
|
||||
image=image,
|
||||
link=link
|
||||
link=link,
|
||||
server_type="jellyfin"
|
||||
))
|
||||
return libraries
|
||||
|
||||
@@ -934,7 +935,8 @@ class Jellyfin:
|
||||
type=item_type,
|
||||
image=image,
|
||||
link=link,
|
||||
percent=item.get("UserData", {}).get("PlayedPercentage")
|
||||
percent=item.get("UserData", {}).get("PlayedPercentage"),
|
||||
server_type='jellyfin',
|
||||
))
|
||||
return ret_resume
|
||||
else:
|
||||
@@ -986,7 +988,8 @@ class Jellyfin:
|
||||
type=item_type,
|
||||
image=image,
|
||||
link=link,
|
||||
BackdropImageTags=item.get("BackdropImageTags")
|
||||
BackdropImageTags=item.get("BackdropImageTags"),
|
||||
server_type='jellyfin'
|
||||
))
|
||||
return ret_latest
|
||||
else:
|
||||
|
||||
@@ -154,7 +154,8 @@ class Plex:
|
||||
type=library_type,
|
||||
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}"
|
||||
f"/com.plexapp.plugins.library?source={library.key}&X-Plex-Token={self._token}",
|
||||
server_type='plex'
|
||||
)
|
||||
)
|
||||
return libraries
|
||||
@@ -755,7 +756,8 @@ class Plex:
|
||||
type=item_type,
|
||||
image=image,
|
||||
link=link,
|
||||
percent=item.viewOffset / item.duration * 100 if item.viewOffset and item.duration else 0
|
||||
percent=item.viewOffset / item.duration * 100 if item.viewOffset and item.duration else 0,
|
||||
server_type='plex'
|
||||
))
|
||||
return ret_resume[:num]
|
||||
|
||||
@@ -823,7 +825,8 @@ class Plex:
|
||||
subtitle=item.year,
|
||||
type=item_type,
|
||||
image=image,
|
||||
link=link
|
||||
link=link,
|
||||
server_type='plex'
|
||||
))
|
||||
offset += num
|
||||
return ret_resume[:num]
|
||||
|
||||
@@ -163,6 +163,7 @@ class TrimeMedia:
|
||||
for img_path in library.posters or []
|
||||
],
|
||||
link=f"{self._playhost or self._api.host}/library/{library.guid}",
|
||||
server_type='trimemedia'
|
||||
)
|
||||
)
|
||||
return libraries
|
||||
@@ -458,6 +459,7 @@ class TrimeMedia:
|
||||
if item.duration and item.ts is not None
|
||||
else 0
|
||||
),
|
||||
server_type='trimemedia',
|
||||
)
|
||||
|
||||
def get_items(
|
||||
|
||||
@@ -72,6 +72,8 @@ class MediaServerLibrary(BaseModel):
|
||||
image_list: Optional[List[str]] = None
|
||||
# 跳转链接
|
||||
link: Optional[str] = None
|
||||
# 服务器类型
|
||||
server_type: Optional[str] = None
|
||||
|
||||
|
||||
class MediaServerItemUserState(BaseModel):
|
||||
@@ -175,3 +177,4 @@ class MediaServerPlayItem(BaseModel):
|
||||
link: Optional[str] = None
|
||||
percent: Optional[float] = None
|
||||
BackdropImageTags: Optional[list] = Field(default_factory=list)
|
||||
server_type: Optional[str] = None
|
||||
|
||||
Reference in New Issue
Block a user