mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-08-27 11:11:07 +08:00
fix(scrap):修复自动整理电影、电视剧主海报不为原始语种
This commit is contained in:
@@ -449,23 +449,19 @@ class MediaChain(ChainBase, metaclass=Singleton):
|
|||||||
# 生成目录内图片文件
|
# 生成目录内图片文件
|
||||||
if init_folder:
|
if init_folder:
|
||||||
# 图片
|
# 图片
|
||||||
for attr_name, attr_value in vars(mediainfo).items():
|
image_dict = self.metadata_img(mediainfo=mediainfo)
|
||||||
if attr_value \
|
if image_dict:
|
||||||
and attr_name.endswith("_path") \
|
for image_name, image_url in image_dict.items():
|
||||||
and attr_value \
|
image_path = filepath.with_name(image_name)
|
||||||
and isinstance(attr_value, str) \
|
|
||||||
and attr_value.startswith("http"):
|
|
||||||
image_name = attr_name.replace("_path", "") + Path(attr_value).suffix
|
|
||||||
image_path = filepath / image_name
|
|
||||||
if overwrite or not self.storagechain.get_file_item(storage=fileitem.storage,
|
if overwrite or not self.storagechain.get_file_item(storage=fileitem.storage,
|
||||||
path=image_path):
|
path=image_path):
|
||||||
# 下载图片
|
# 下载图片
|
||||||
content = __download_image(_url=attr_value)
|
content = __download_image(image_url)
|
||||||
# 写入图片到当前目录
|
# 写入图片到当前目录
|
||||||
if content:
|
if content:
|
||||||
__save_file(_fileitem=fileitem, _path=image_path, _content=content)
|
__save_file(_fileitem=fileitem, _path=image_path, _content=content)
|
||||||
else:
|
else:
|
||||||
logger.info(f"已存在图片文件:{image_path}")
|
logger.info(f"已存在图片文件:{image_path}")
|
||||||
else:
|
else:
|
||||||
# 电视剧
|
# 电视剧
|
||||||
if fileitem.type == "file":
|
if fileitem.type == "file":
|
||||||
|
|||||||
@@ -101,15 +101,24 @@ class TmdbScraper:
|
|||||||
return images
|
return images
|
||||||
else:
|
else:
|
||||||
# 主媒体图片
|
# 主媒体图片
|
||||||
for attr_name, attr_value in vars(mediainfo).items():
|
_mediainfo = self.original_tmdb(mediainfo).get_info(mediainfo.type, mediainfo.tmdb_id)
|
||||||
if attr_value \
|
if _mediainfo:
|
||||||
and attr_name.endswith("_path") \
|
for attr_name, attr_value in _mediainfo.items():
|
||||||
and attr_value \
|
if attr_name.endswith("_path") and attr_value is not None:
|
||||||
and isinstance(attr_value, str) \
|
image_url = f"https://{settings.TMDB_IMAGE_DOMAIN}/t/p/original{attr_value}"
|
||||||
and attr_value.startswith("http"):
|
image_name = attr_name.replace("_path", "") + Path(image_url).suffix
|
||||||
image_name = attr_name.replace("_path", "") + Path(attr_value).suffix
|
images[image_name] = image_url
|
||||||
images[image_name] = attr_value
|
return images
|
||||||
return images
|
else:
|
||||||
|
for attr_name, attr_value in vars(mediainfo).items():
|
||||||
|
if attr_value \
|
||||||
|
and attr_name.endswith("_path") \
|
||||||
|
and attr_value \
|
||||||
|
and isinstance(attr_value, str) \
|
||||||
|
and attr_value.startswith("http"):
|
||||||
|
image_name = attr_name.replace("_path", "") + Path(attr_value).suffix
|
||||||
|
images[image_name] = attr_value
|
||||||
|
return images
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_season_poster(seasoninfo: dict, season: int) -> Tuple[str, str]:
|
def get_season_poster(seasoninfo: dict, season: int) -> Tuple[str, str]:
|
||||||
|
|||||||
Reference in New Issue
Block a user