feat: tmdbid优先识别,同ID电影/电视剧通过元数据自动消歧

当名称中包含 {tmdbid=xxx} 时,优先使用tmdbid直接查询TMDB,不再回退到标题搜索。
当同一tmdbid同时存在电影和电视剧时,通过标题、年份、类型等元数据自动消歧。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
DDSRem
2026-03-26 06:45:17 +08:00
committed by jxxghp
co-authored by Claude Opus 4.6
parent c85d3adb34
commit 1acf78342c
3 changed files with 263 additions and 15 deletions
+6 -6
View File
@@ -403,16 +403,16 @@ class ChainBase(metaclass=ABCMeta):
:return: 识别的媒体信息,包括剧集信息
"""
# 识别用名中含指定信息情形
if not mtype and meta and meta.type in [MediaType.TV, MediaType.MOVIE]:
mtype = meta.type
if not tmdbid and hasattr(meta, "tmdbid"):
tmdbid = meta.tmdbid
if not doubanid and hasattr(meta, "doubanid"):
doubanid = meta.doubanid
# 有tmdbid时不使用其它ID
# 有tmdbid时,不使用meta推断的类型(由消歧逻辑决定),也不使用其它ID
if tmdbid:
doubanid = None
bangumiid = None
elif not mtype and meta and meta.type in [MediaType.TV, MediaType.MOVIE]:
mtype = meta.type
with fresh(not cache):
return self.run_module(
"recognize_media",
@@ -447,16 +447,16 @@ class ChainBase(metaclass=ABCMeta):
:return: 识别的媒体信息,包括剧集信息
"""
# 识别用名中含指定信息情形
if not mtype and meta and meta.type in [MediaType.TV, MediaType.MOVIE]:
mtype = meta.type
if not tmdbid and hasattr(meta, "tmdbid"):
tmdbid = meta.tmdbid
if not doubanid and hasattr(meta, "doubanid"):
doubanid = meta.doubanid
# 有tmdbid时不使用其它ID
# 有tmdbid时,不使用meta推断的类型(由消歧逻辑决定),也不使用其它ID
if tmdbid:
doubanid = None
bangumiid = None
elif not mtype and meta and meta.type in [MediaType.TV, MediaType.MOVIE]:
mtype = meta.type
async with async_fresh(not cache):
return await self.async_run_module(
"async_recognize_media",