mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-09 01:16:50 +08:00
fix: 修复订阅自定义识别词在整理时不生效的问题
问题:订阅中添加的自定义识别词(特别是集数偏移)在下载时正常生效, 但在下载完成整理时没有生效。 根因:下载历史中未保存识别词,整理时 MetaInfoPath 未接收 custom_words 参数。 修复: - 在 DownloadHistory 模型中添加 custom_words 字段 - 下载时从 meta.apply_words 获取并保存识别词到下载历史 - MetaInfoPath 函数添加 custom_words 参数支持 - 整理时从下载历史获取 custom_words 并传递给 MetaInfoPath - 添加 Alembic 迁移脚本 (2.2.3) - 添加相关单元测试
This commit is contained in:
@@ -292,6 +292,10 @@ class DownloadChain(ChainBase):
|
||||
|
||||
# 登记下载记录
|
||||
downloadhis = DownloadHistoryOper()
|
||||
# 获取应用的识别词(如果有)
|
||||
custom_words_str = None
|
||||
if hasattr(_meta, 'apply_words') and _meta.apply_words:
|
||||
custom_words_str = '\n'.join(_meta.apply_words)
|
||||
downloadhis.add(
|
||||
path=download_path.as_posix(),
|
||||
type=_media.type.value,
|
||||
@@ -315,6 +319,7 @@ class DownloadChain(ChainBase):
|
||||
date=time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()),
|
||||
media_category=_media.category,
|
||||
episode_group=_media.episode_group,
|
||||
custom_words=custom_words_str,
|
||||
note={"source": source}
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user