mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-05 07:27:15 +08:00
fix(search): 支持单次搜索启用多个媒体数据源,合并显示所有源结果 (#6270)
- 新增 is_media_source_enabled/is_media_source_selected,请求级 source 支持逗号分隔多数据源,缺省回退全局 SEARCH_SOURCE 配置 - 四个媒体模块的搜索/人物/合集方法统一接入多源判断 - 补充多数据源搜索相关测试
This commit is contained in:
@@ -10,6 +10,7 @@ from app.modules import _ModuleBase
|
||||
from app.modules.bangumi.bangumi import BangumiApi
|
||||
from app.schemas.types import MediaRecognizeType, MediaType, ModuleType
|
||||
from app.utils.http import RequestUtils
|
||||
from app.utils.media import is_media_source_enabled
|
||||
|
||||
|
||||
class BangumiModule(_ModuleBase):
|
||||
@@ -202,9 +203,7 @@ class BangumiModule(_ModuleBase):
|
||||
:param source: 请求级搜索数据源
|
||||
:return: 媒体信息
|
||||
"""
|
||||
if source and source != "bangumi":
|
||||
return None
|
||||
if not source and settings.SEARCH_SOURCE and "bangumi" not in settings.SEARCH_SOURCE:
|
||||
if not is_media_source_enabled(source, "bangumi"):
|
||||
return None
|
||||
if not meta.name:
|
||||
return []
|
||||
@@ -224,9 +223,7 @@ class BangumiModule(_ModuleBase):
|
||||
:param source: 请求级搜索数据源
|
||||
:return: 媒体信息
|
||||
"""
|
||||
if source and source != "bangumi":
|
||||
return None
|
||||
if not source and settings.SEARCH_SOURCE and "bangumi" not in settings.SEARCH_SOURCE:
|
||||
if not is_media_source_enabled(source, "bangumi"):
|
||||
return None
|
||||
if not meta.name:
|
||||
return []
|
||||
|
||||
Reference in New Issue
Block a user