Skip to content

Commit a0b19a5

Browse files
committed
Async loading workshop items for chara_manager.
1 parent 23c7289 commit a0b19a5

5 files changed

Lines changed: 138 additions & 208 deletions

File tree

main_routers/characters_router.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ async def get_current_live2d_model(catgirl_name: str = "", item_id: str = ""):
188188
# 同时获取工坊模型列表,确保能找到工坊模型
189189
try:
190190
from .workshop_router import get_subscribed_workshop_items
191-
workshop_result = get_subscribed_workshop_items()
191+
workshop_result = await get_subscribed_workshop_items()
192192
if isinstance(workshop_result, dict) and workshop_result.get('success', False):
193193
for item in workshop_result.get('items', []):
194194
installed_folder = item.get('installedFolder')

main_routers/live2d_router.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727

2828
@router.get("/models")
29-
def get_live2d_models(simple: bool = False):
29+
async def get_live2d_models(simple: bool = False):
3030
"""
3131
获取Live2D模型列表
3232
Args:
@@ -38,7 +38,7 @@ def get_live2d_models(simple: bool = False):
3838

3939
# 再获取Steam创意工坊模型
4040
try:
41-
workshop_items_result = get_subscribed_workshop_items()
41+
workshop_items_result = await get_subscribed_workshop_items()
4242

4343
# 处理响应结果
4444
if isinstance(workshop_items_result, dict) and workshop_items_result.get('success', False):

0 commit comments

Comments
 (0)