fix: plex最近添加的剧集封面地址
This commit is contained in:
parent
4d48295f72
commit
089d4785aa
@ -4,7 +4,7 @@ from pathlib import Path
|
|||||||
from typing import List, Optional, Dict, Tuple, Generator, Any
|
from typing import List, Optional, Dict, Tuple, Generator, Any
|
||||||
from urllib.parse import quote_plus
|
from urllib.parse import quote_plus
|
||||||
|
|
||||||
from plexapi import media, utils
|
from plexapi import media
|
||||||
from plexapi.server import PlexServer
|
from plexapi.server import PlexServer
|
||||||
|
|
||||||
from app import schemas
|
from app import schemas
|
||||||
@ -679,19 +679,20 @@ class Plex:
|
|||||||
for item in sub_result:
|
for item in sub_result:
|
||||||
if len(ret_resume) >= num:
|
if len(ret_resume) >= num:
|
||||||
break
|
break
|
||||||
item_type = ""
|
item_type, title, image = "", "", ""
|
||||||
title = ""
|
|
||||||
if item.TYPE == "movie":
|
if item.TYPE == "movie":
|
||||||
item_type = MediaType.MOVIE.value
|
item_type = MediaType.MOVIE.value
|
||||||
title = item.title
|
title = item.title
|
||||||
|
image = item.posterUrl
|
||||||
elif item.TYPE == "season":
|
elif item.TYPE == "season":
|
||||||
item_type = MediaType.TV.value
|
item_type = MediaType.TV.value
|
||||||
title = "%s 第%s季" % (item.parentTitle, item.index)
|
title = "%s 第%s季" % (item.parentTitle, item.index)
|
||||||
|
image = item.posterUrl
|
||||||
elif item.TYPE == "episode":
|
elif item.TYPE == "episode":
|
||||||
item_type = MediaType.TV.value
|
item_type = MediaType.TV.value
|
||||||
title = "%s 第%s季 第%s集" % (item.grandparentTitle, item.parentIndex, item.index)
|
title = "%s 第%s季 第%s集" % (item.grandparentTitle, item.parentIndex, item.index)
|
||||||
link = self.get_play_url(item.key).rstrip('/children')
|
image = self._host + item.parentThumb.lstrip('/') + f"?X-Plex-Token={self._token}"
|
||||||
image = item.posterUrl
|
link = self.get_play_url(item.key)
|
||||||
ret_resume.append(schemas.MediaServerPlayItem(
|
ret_resume.append(schemas.MediaServerPlayItem(
|
||||||
id=item.key,
|
id=item.key,
|
||||||
title=title,
|
title=title,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user