Archived
refactor: 移除 music_api 的 16 个死掉的同步兼容门面
music_api/compat.py 是「同步调用异步实现」的桥接门面——每个方法都用 core.async_bridge.run_sync 把 NeteaseAPI 的协程跑起来。调用方此前已陆续 迁到原生异步(await NeteaseAPI().xxx()),这 16 个方法在仓内(web/ services/ tests/ CLI)已零调用,只剩 __init__ 的再导出,属迁移期残留。 仅 url_v1 还有唯一调用方(music_api.podcast 的同步解析路径),予以保留, 并在 docstring 标注「应删不应增」,待 worker 子系统异步化时一并清除。 门禁:ruff 全过 / pyright 0-0 / pytest 387 项,失败数与前次一致(2 项 index golden,源于未提交的前端迁移,与本次无关)。
This commit is contained in:
1 parent
6fb37534d3
commit
0dbbb3ed63
2 files changed
+5
-142
No files matched your search
@@ -24,24 +24,7 @@ from .client import (
|
||||
_ensure_dict,
|
||||
)
|
||||
from .compat import (
|
||||
account_info,
|
||||
album_detail,
|
||||
album_subscribe,
|
||||
artist_songs,
|
||||
detect_vip_by_probe,
|
||||
get_pic_url,
|
||||
lyric_v1,
|
||||
name_v1,
|
||||
playlist_detail,
|
||||
playlist_subscribe,
|
||||
post_comment,
|
||||
probe_levels,
|
||||
qr_login,
|
||||
search_music,
|
||||
song_comments,
|
||||
toplist_list,
|
||||
url_v1,
|
||||
user_playlists,
|
||||
)
|
||||
from .constants import (
|
||||
APIConstants,
|
||||
@@ -76,24 +59,7 @@ __all__ = [
|
||||
'WeapiCrypto',
|
||||
'_as_dict',
|
||||
'_ensure_dict',
|
||||
'account_info',
|
||||
'album_detail',
|
||||
'album_subscribe',
|
||||
'artist_songs',
|
||||
'detect_vip_by_probe',
|
||||
'get_pic_url',
|
||||
'load_cookies',
|
||||
'lyric_v1',
|
||||
'name_v1',
|
||||
'parse_cookie_string',
|
||||
'playlist_detail',
|
||||
'playlist_subscribe',
|
||||
'post_comment',
|
||||
'probe_levels',
|
||||
'qr_login',
|
||||
'search_music',
|
||||
'song_comments',
|
||||
'toplist_list',
|
||||
'url_v1',
|
||||
'user_playlists',
|
||||
]
|
||||
Reference in new issue
Block a user