Skip to content

Commit 23fe643

Browse files
authored
Merge pull request #2534 from InfinityPacer/main
2 parents 545b3c0 + f102119 commit 23fe643

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

app/modules/plex/plex.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -288,26 +288,26 @@ def get_remote_image_by_id(self, item_id: str, image_type: str, depth: int = 0)
288288
if item.thumb:
289289
image_url = RequestUtils.combine_url(host=settings.PLEX_PLAY_HOST, path=item.thumb, query=query)
290290
else:
291-
# 这里对episode进行特殊处理,实际上episode的Backdrop是Poster
292-
if item.TYPE == "episode" and item.thumb:
293-
image_url = RequestUtils.combine_url(host=settings.PLEX_PLAY_HOST, path=item.thumb, query=query)
294291
# 默认使用art也就是Backdrop进行处理
295-
if not image_url and item.art:
292+
if item.art:
296293
image_url = RequestUtils.combine_url(host=settings.PLEX_PLAY_HOST, path=item.art, query=query)
294+
# 这里对episode进行特殊处理,实际上episode的Backdrop是Poster
295+
# 也有个别情况,比如机智的凡人小子episode就是Poster,因此这里把episode的优先级降低,默认还是取art
296+
if not image_url and item.TYPE == "episode" and item.thumb:
297+
image_url = RequestUtils.combine_url(host=settings.PLEX_PLAY_HOST, path=item.thumb, query=query)
297298
else:
298299
if image_type == "Poster":
299300
images = self._plex.fetchItems(ekey=f"{ekey}/posters",
300301
cls=media.Poster)
301302
else:
303+
# 默认使用art也就是Backdrop进行处理
304+
images = self._plex.fetchItems(ekey=f"{ekey}/arts",
305+
cls=media.Art)
302306
# 这里对episode进行特殊处理,实际上episode的Backdrop是Poster
303-
images = None
304-
if item.TYPE == "episode":
307+
# 也有个别情况,比如机智的凡人小子episode就是Poster,因此这里把episode的优先级降低,默认还是取art
308+
if not images and item.TYPE == "episode":
305309
images = self._plex.fetchItems(ekey=f"{ekey}/posters",
306310
cls=media.Poster)
307-
# 默认使用art也就是Backdrop进行处理
308-
if not images:
309-
images = self._plex.fetchItems(ekey=f"{ekey}/arts",
310-
cls=media.Art)
311311
for image in images:
312312
if hasattr(image, "key") and image.key.startswith("http"):
313313
image_url = image.key

app/utils/http.py

+1
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ def combine_url(host: str, path: Optional[str] = None, query: Optional[dict] = N
269269
# 如果路径为空,则默认为 '/'
270270
if path is None:
271271
path = '/'
272+
host = RequestUtils.standardize_base_url(host)
272273
# 使用 urljoin 合并 host 和 path
273274
url = urljoin(host, path)
274275
# 解析当前 URL 的组成部分

0 commit comments

Comments
 (0)