fix(types): align chain server response contracts

This commit is contained in:
jxxghp
2026-10-17 16:25:54 +08:00
parent 8a59bab207
commit 8cd98de3a8

View File

@@ -220,7 +220,7 @@ class _RecognitionShareAdapter:
keyword_meta=keyword_meta,
**({"music_type": music_type} if music_type is not None else {}),
)
return cast(Optional[dict[str, Any]], result)
return result
async def async_query_recognize_share(
self,
@@ -236,17 +236,14 @@ class _RecognitionShareAdapter:
keyword_meta=keyword_meta,
**({"music_type": music_type} if music_type is not None else {}),
)
return cast(Optional[dict[str, Any]], result)
return result
def to_recognize_params(
self,
item: Optional[dict[str, Any]],
) -> Optional[dict[str, Any]]:
"""把服务端结果转换为本地识别参数。"""
return cast(
Optional[dict[str, Any]],
MoviePilotServerHelper.to_recognize_params(item),
)
return MoviePilotServerHelper.to_recognize_params(item)
class _SubscriptionShareAdapter:
@@ -262,7 +259,7 @@ class _SubscriptionShareAdapter:
def list_shares(self) -> list[dict[str, Any]]:
"""读取当前用户可见的订阅分享。"""
return cast(list[dict[str, Any]], MoviePilotServerHelper.get_subscribe_shares())
return MoviePilotServerHelper.get_subscribe_shares()
def report_completed(self, payload: Mapping[str, JsonData]) -> bool:
"""同步上报订阅完成统计。"""