fix: metainfo for manual transfer

This commit is contained in:
Edward
2024-04-12 14:20:41 +00:00
committed by GitHub
parent 172bc23b2a
commit d96e4561e2
4 changed files with 12 additions and 7 deletions

View File

@ -26,7 +26,7 @@ class TmdbScraper:
self.tmdb = tmdb
def gen_scraper_files(self, mediainfo: MediaInfo, file_path: Path, transfer_type: str,
force_nfo: bool = False, force_img: bool = False):
metainfo: MetaInfo = None, force_nfo: bool = False, force_img: bool = False):
"""
生成刮削文件包括NFO和图片传入路径为文件路径
:param mediainfo: 媒体信息
@ -75,8 +75,8 @@ class TmdbScraper:
file_path=image_path)
# 电视剧,路径为每一季的文件名 名称/Season xx/名称 SxxExx.xxx
else:
# 识别
meta = MetaInfo(file_path.stem)
# 如果有上游传入的元信息则使用,否则使用文件名识别
meta = metainfo or MetaInfo(file_path.stem)
# 根目录不存在时才处理
if self._force_nfo or not file_path.parent.with_name("tvshow.nfo").exists():
# 根目录描述文件