fix: avoid duplicate image fetch in transfer

Keep transfer recognition results ready for scraping without fetching images twice on the same path. Also ensure redo-by-path transfer recognition still populates image data before metadata scraping.
This commit is contained in:
jxxghp
2026-05-10 08:22:27 +08:00
parent c52327c248
commit 4d132c424a

View File

@@ -1269,6 +1269,7 @@ class TransferChain(ChainBase, ConfigReloadMixin, metaclass=Singleton):
transferhis = TransferHistoryOper()
mediainfo = task.mediainfo
mediainfo_changed = False
need_obtain_images = False
if not mediainfo:
download_history = task.download_history
# 下载用户
@@ -1283,6 +1284,7 @@ class TransferChain(ChainBase, ConfigReloadMixin, metaclass=Singleton):
doubanid=download_history.doubanid,
episode_group=download_history.episode_group,
)
need_obtain_images = True
if mediainfo:
# 更新自定义媒体类别
if download_history.media_category:
@@ -1294,8 +1296,8 @@ class TransferChain(ChainBase, ConfigReloadMixin, metaclass=Singleton):
obtain_images=True,
)
# 补充图片,确保整理后直接进入刮削的媒体信息已带图片地址
if mediainfo:
# 按名称识别时已在识别链路补图这里只补齐显式ID识别的场景
if mediainfo and need_obtain_images:
self.obtain_images(mediainfo=mediainfo)
if not mediainfo:
@@ -2275,7 +2277,7 @@ class TransferChain(ChainBase, ConfigReloadMixin, metaclass=Singleton):
recognize_context = MediaChain().recognize_by_path(
str(src_path),
episode_group=history.episode_group,
obtain_images=False,
obtain_images=True,
)
mediainfo = recognize_context.media_info if recognize_context else None
if not mediainfo: