fix #2526 Backdrop优先调整为取art
This commit is contained in:
parent
41e2907168
commit
f102119eef
@ -288,26 +288,26 @@ class Plex:
|
|||||||
if item.thumb:
|
if item.thumb:
|
||||||
image_url = RequestUtils.combine_url(host=settings.PLEX_PLAY_HOST, path=item.thumb, query=query)
|
image_url = RequestUtils.combine_url(host=settings.PLEX_PLAY_HOST, path=item.thumb, query=query)
|
||||||
else:
|
else:
|
||||||
# 这里对episode进行特殊处理,实际上episode的Backdrop是Poster
|
|
||||||
if item.TYPE == "episode" and item.thumb:
|
|
||||||
image_url = RequestUtils.combine_url(host=settings.PLEX_PLAY_HOST, path=item.thumb, query=query)
|
|
||||||
# 默认使用art也就是Backdrop进行处理
|
# 默认使用art也就是Backdrop进行处理
|
||||||
if not image_url and item.art:
|
if item.art:
|
||||||
image_url = RequestUtils.combine_url(host=settings.PLEX_PLAY_HOST, path=item.art, query=query)
|
image_url = RequestUtils.combine_url(host=settings.PLEX_PLAY_HOST, path=item.art, query=query)
|
||||||
|
# 这里对episode进行特殊处理,实际上episode的Backdrop是Poster
|
||||||
|
# 也有个别情况,比如机智的凡人小子episode就是Poster,因此这里把episode的优先级降低,默认还是取art
|
||||||
|
if not image_url and item.TYPE == "episode" and item.thumb:
|
||||||
|
image_url = RequestUtils.combine_url(host=settings.PLEX_PLAY_HOST, path=item.thumb, query=query)
|
||||||
else:
|
else:
|
||||||
if image_type == "Poster":
|
if image_type == "Poster":
|
||||||
images = self._plex.fetchItems(ekey=f"{ekey}/posters",
|
images = self._plex.fetchItems(ekey=f"{ekey}/posters",
|
||||||
cls=media.Poster)
|
cls=media.Poster)
|
||||||
else:
|
else:
|
||||||
|
# 默认使用art也就是Backdrop进行处理
|
||||||
|
images = self._plex.fetchItems(ekey=f"{ekey}/arts",
|
||||||
|
cls=media.Art)
|
||||||
# 这里对episode进行特殊处理,实际上episode的Backdrop是Poster
|
# 这里对episode进行特殊处理,实际上episode的Backdrop是Poster
|
||||||
images = None
|
# 也有个别情况,比如机智的凡人小子episode就是Poster,因此这里把episode的优先级降低,默认还是取art
|
||||||
if item.TYPE == "episode":
|
if not images and item.TYPE == "episode":
|
||||||
images = self._plex.fetchItems(ekey=f"{ekey}/posters",
|
images = self._plex.fetchItems(ekey=f"{ekey}/posters",
|
||||||
cls=media.Poster)
|
cls=media.Poster)
|
||||||
# 默认使用art也就是Backdrop进行处理
|
|
||||||
if not images:
|
|
||||||
images = self._plex.fetchItems(ekey=f"{ekey}/arts",
|
|
||||||
cls=media.Art)
|
|
||||||
for image in images:
|
for image in images:
|
||||||
if hasattr(image, "key") and image.key.startswith("http"):
|
if hasattr(image, "key") and image.key.startswith("http"):
|
||||||
image_url = image.key
|
image_url = image.key
|
||||||
|
@ -269,6 +269,7 @@ class RequestUtils:
|
|||||||
# 如果路径为空,则默认为 '/'
|
# 如果路径为空,则默认为 '/'
|
||||||
if path is None:
|
if path is None:
|
||||||
path = '/'
|
path = '/'
|
||||||
|
host = RequestUtils.standardize_base_url(host)
|
||||||
# 使用 urljoin 合并 host 和 path
|
# 使用 urljoin 合并 host 和 path
|
||||||
url = urljoin(host, path)
|
url = urljoin(host, path)
|
||||||
# 解析当前 URL 的组成部分
|
# 解析当前 URL 的组成部分
|
||||||
|
Loading…
x
Reference in New Issue
Block a user