mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-05 07:27:15 +08:00
fix: merge downloader tracker mappings
This commit is contained in:
@@ -383,6 +383,12 @@ class ModuleInvocationDispatcher:
|
||||
if isinstance(result, list)
|
||||
else _ProviderCallMode.STOP
|
||||
)
|
||||
if aggregation is ModuleResultAggregation.ORDERED_MAPPING_MERGE:
|
||||
return (
|
||||
_ProviderCallMode.ORIGINAL
|
||||
if isinstance(result, dict)
|
||||
else _ProviderCallMode.STOP
|
||||
)
|
||||
if allow_relay and ObjectUtils.check_signature(func, result):
|
||||
return _ProviderCallMode.RELAY
|
||||
if isinstance(result, list):
|
||||
@@ -396,10 +402,14 @@ class ModuleInvocationDispatcher:
|
||||
call_mode: _ProviderCallMode,
|
||||
) -> Any:
|
||||
"""合并单个 provider 结果,接力调用则用新结果替换旧结果。"""
|
||||
if call_mode is _ProviderCallMode.RELAY or not isinstance(result, list):
|
||||
if call_mode is _ProviderCallMode.RELAY:
|
||||
return provider_result
|
||||
if isinstance(provider_result, list):
|
||||
if isinstance(result, list) and isinstance(provider_result, list):
|
||||
result.extend(provider_result)
|
||||
elif isinstance(result, dict) and isinstance(provider_result, dict):
|
||||
result.update(provider_result)
|
||||
elif not isinstance(result, (list, dict)):
|
||||
return provider_result
|
||||
return result
|
||||
|
||||
@staticmethod
|
||||
|
||||
Reference in New Issue
Block a user