mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-06-09 01:31:05 +08:00
Merge pull request #2898 from thsrite/dev
This commit is contained in:
@@ -338,6 +338,7 @@ class MediaChain(ChainBase, metaclass=Singleton):
|
|||||||
tmp_file = settings.TEMP_PATH / _path.name
|
tmp_file = settings.TEMP_PATH / _path.name
|
||||||
tmp_file.write_bytes(_content)
|
tmp_file.write_bytes(_content)
|
||||||
logger.info(f"保存文件:【{_fileitem.storage}】{_path}")
|
logger.info(f"保存文件:【{_fileitem.storage}】{_path}")
|
||||||
|
_fileitem.path = str(_path.parent)
|
||||||
self.storagechain.upload_file(fileitem=_fileitem, path=tmp_file)
|
self.storagechain.upload_file(fileitem=_fileitem, path=tmp_file)
|
||||||
if tmp_file.exists():
|
if tmp_file.exists():
|
||||||
tmp_file.unlink()
|
tmp_file.unlink()
|
||||||
@@ -402,7 +403,8 @@ class MediaChain(ChainBase, metaclass=Singleton):
|
|||||||
and attr_value.startswith("http"):
|
and attr_value.startswith("http"):
|
||||||
image_name = attr_name.replace("_path", "") + Path(attr_value).suffix
|
image_name = attr_name.replace("_path", "") + Path(attr_value).suffix
|
||||||
image_path = filepath / image_name
|
image_path = filepath / image_name
|
||||||
if not overwrite and self.storagechain.get_file_item(storage=fileitem.storage, path=image_path):
|
if not overwrite and self.storagechain.get_file_item(storage=fileitem.storage,
|
||||||
|
path=image_path):
|
||||||
logger.info(f"已存在图片文件:{image_path}")
|
logger.info(f"已存在图片文件:{image_path}")
|
||||||
continue
|
continue
|
||||||
# 下载图片
|
# 下载图片
|
||||||
@@ -476,7 +478,8 @@ class MediaChain(ChainBase, metaclass=Singleton):
|
|||||||
if image_dict:
|
if image_dict:
|
||||||
for image_name, image_url in image_dict.items():
|
for image_name, image_url in image_dict.items():
|
||||||
image_path = filepath.with_name(image_name)
|
image_path = filepath.with_name(image_name)
|
||||||
if not overwrite and self.storagechain.get_file_item(storage=fileitem.storage, path=image_path):
|
if not overwrite and self.storagechain.get_file_item(storage=fileitem.storage,
|
||||||
|
path=image_path):
|
||||||
logger.info(f"已存在图片文件:{image_path}")
|
logger.info(f"已存在图片文件:{image_path}")
|
||||||
continue
|
continue
|
||||||
# 下载图片
|
# 下载图片
|
||||||
@@ -500,7 +503,8 @@ class MediaChain(ChainBase, metaclass=Singleton):
|
|||||||
if image_dict:
|
if image_dict:
|
||||||
for image_name, image_url in image_dict.items():
|
for image_name, image_url in image_dict.items():
|
||||||
image_path = filepath / image_name
|
image_path = filepath / image_name
|
||||||
if not overwrite and self.storagechain.get_file_item(storage=fileitem.storage, path=image_path):
|
if not overwrite and self.storagechain.get_file_item(storage=fileitem.storage,
|
||||||
|
path=image_path):
|
||||||
logger.info(f"已存在图片文件:{image_path}")
|
logger.info(f"已存在图片文件:{image_path}")
|
||||||
continue
|
continue
|
||||||
# 下载图片
|
# 下载图片
|
||||||
|
|||||||
@@ -58,19 +58,19 @@ class TmdbScraper:
|
|||||||
"""
|
"""
|
||||||
images = {}
|
images = {}
|
||||||
if season:
|
if season:
|
||||||
# 只需要季的图片
|
# 只需要集的图片
|
||||||
if episode:
|
if episode:
|
||||||
# 季的图片
|
# 集的图片
|
||||||
seasoninfo = self.tmdb.get_tv_season_detail(mediainfo.tmdb_id, season)
|
seasoninfo = self.tmdb.get_tv_season_detail(mediainfo.tmdb_id, season)
|
||||||
if seasoninfo:
|
if seasoninfo:
|
||||||
episodeinfo = self.__get_episode_detail(seasoninfo, episode)
|
episodeinfo = self.__get_episode_detail(seasoninfo, episode)
|
||||||
if episodeinfo:
|
if episodeinfo and episodeinfo.get("still_path"):
|
||||||
# TMDB集still图片
|
# TMDB集still图片
|
||||||
still_name = f"{episode}"
|
still_name = f"{episode}"
|
||||||
still_url = f"https://{settings.TMDB_IMAGE_DOMAIN}/t/p/original{episodeinfo.get('still_path')}"
|
still_url = f"https://{settings.TMDB_IMAGE_DOMAIN}/t/p/original{episodeinfo.get('still_path')}"
|
||||||
images[still_name] = still_url
|
images[still_name] = still_url
|
||||||
else:
|
else:
|
||||||
# 集的图片
|
# 季的图片
|
||||||
seasoninfo = self.tmdb.get_tv_season_detail(mediainfo.tmdb_id, season)
|
seasoninfo = self.tmdb.get_tv_season_detail(mediainfo.tmdb_id, season)
|
||||||
if seasoninfo:
|
if seasoninfo:
|
||||||
# TMDB季poster图片
|
# TMDB季poster图片
|
||||||
|
|||||||
Reference in New Issue
Block a user