fix actor thumb
This commit is contained in:
parent
79c7475435
commit
89854d188d
@ -5,6 +5,7 @@ from cachetools import cached, TTLCache
|
|||||||
|
|
||||||
from app import schemas
|
from app import schemas
|
||||||
from app.chain import ChainBase
|
from app.chain import ChainBase
|
||||||
|
from app.core.config import settings
|
||||||
from app.schemas import MediaType
|
from app.schemas import MediaType
|
||||||
from app.utils.singleton import Singleton
|
from app.utils.singleton import Singleton
|
||||||
|
|
||||||
@ -122,5 +123,5 @@ class TmdbChain(ChainBase, metaclass=Singleton):
|
|||||||
while True:
|
while True:
|
||||||
info = random.choice(infos)
|
info = random.choice(infos)
|
||||||
if info and info.get("backdrop_path"):
|
if info and info.get("backdrop_path"):
|
||||||
return f"https://image.tmdb.org/t/p/original{info.get('backdrop_path')}"
|
return f"https://{settings.TMDB_IMAGE_DOMAIN}/t/p/original{info.get('backdrop_path')}"
|
||||||
return None
|
return None
|
||||||
|
@ -345,7 +345,7 @@ class TheMovieDbModule(_ModuleBase):
|
|||||||
image_path = seasoninfo.get(image_type.value)
|
image_path = seasoninfo.get(image_type.value)
|
||||||
|
|
||||||
if image_path:
|
if image_path:
|
||||||
return f"https://image.tmdb.org/t/p/{image_prefix}{image_path}"
|
return f"https://{settings.TMDB_IMAGE_DOMAIN}/t/p/{image_prefix}{image_path}"
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def movie_similar(self, tmdbid: int) -> List[dict]:
|
def movie_similar(self, tmdbid: int) -> List[dict]:
|
||||||
|
@ -165,6 +165,10 @@ class TmdbScraper:
|
|||||||
DomUtils.add_node(doc, xactor, "type", "Actor")
|
DomUtils.add_node(doc, xactor, "type", "Actor")
|
||||||
DomUtils.add_node(doc, xactor, "role", actor.get("character") or actor.get("role") or "")
|
DomUtils.add_node(doc, xactor, "role", actor.get("character") or actor.get("role") or "")
|
||||||
DomUtils.add_node(doc, xactor, "tmdbid", actor.get("id") or "")
|
DomUtils.add_node(doc, xactor, "tmdbid", actor.get("id") or "")
|
||||||
|
DomUtils.add_node(doc, xactor, "thumb",
|
||||||
|
f"https://{settings.TMDB_IMAGE_DOMAIN}/t/p/original{actor.get('profile_path')}")
|
||||||
|
DomUtils.add_node(doc, xactor, "profile",
|
||||||
|
f"https://www.themoviedb.org/person/{actor.get('id')}")
|
||||||
# 风格
|
# 风格
|
||||||
genres = mediainfo.genres or []
|
genres = mediainfo.genres or []
|
||||||
for genre in genres:
|
for genre in genres:
|
||||||
@ -317,6 +321,10 @@ class TmdbScraper:
|
|||||||
DomUtils.add_node(doc, xactor, "name", actor.get("name") or "")
|
DomUtils.add_node(doc, xactor, "name", actor.get("name") or "")
|
||||||
DomUtils.add_node(doc, xactor, "type", "Actor")
|
DomUtils.add_node(doc, xactor, "type", "Actor")
|
||||||
DomUtils.add_node(doc, xactor, "tmdbid", actor.get("id") or "")
|
DomUtils.add_node(doc, xactor, "tmdbid", actor.get("id") or "")
|
||||||
|
DomUtils.add_node(doc, xactor, "thumb",
|
||||||
|
f"https://{settings.TMDB_IMAGE_DOMAIN}/t/p/original{actor.get('profile_path')}")
|
||||||
|
DomUtils.add_node(doc, xactor, "profile",
|
||||||
|
f"https://www.themoviedb.org/person/{actor.get('id')}")
|
||||||
# 保存文件
|
# 保存文件
|
||||||
self.__save_nfo(doc, file_path.with_suffix(".nfo"))
|
self.__save_nfo(doc, file_path.with_suffix(".nfo"))
|
||||||
|
|
||||||
|
@ -506,7 +506,7 @@ class PersonMeta(_PluginBase):
|
|||||||
profile_path = person_tmdbinfo.get('profile_path')
|
profile_path = person_tmdbinfo.get('profile_path')
|
||||||
if profile_path:
|
if profile_path:
|
||||||
logger.info(f"{people.get('Name')} 从TMDB获取到图片:{profile_path}")
|
logger.info(f"{people.get('Name')} 从TMDB获取到图片:{profile_path}")
|
||||||
profile_path = f"https://image.tmdb.org/t/p/original{profile_path}"
|
profile_path = f"https://{settings.TMDB_IMAGE_DOMAIN}/t/p/original{profile_path}"
|
||||||
|
|
||||||
# 从豆瓣信息中更新人物信息
|
# 从豆瓣信息中更新人物信息
|
||||||
if douban_actors and (not updated_name
|
if douban_actors and (not updated_name
|
||||||
|
Loading…
x
Reference in New Issue
Block a user