Skip to content

Commit d9022e9

Browse files
committed
🐛 修复获取语音角色逻辑,添加角色查找功能并更新版本号至0.2.8
1 parent 0156ff5 commit d9022e9

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

.github/workflows/python.yml

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ name: Python package
55

66
on:
77
push:
8-
# 所有分支都会触发
98
branches: [ "*" ]
109
pull_request:
1110
branches: [ "*" ]

nonebot_plugin_fishspeech_tts/fish_audio_api.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,10 @@ async def _get_reference_id_by_speaker(self, speaker: str) -> str:
7474
if resp_data["total"] == 0:
7575
raise APIException("获取语音角色列表为空")
7676
else:
77-
return resp_data["items"][0]["_id"]
77+
for item in resp_data["items"]:
78+
if speaker in item["title"]:
79+
return item["_id"]
80+
raise APIException("未找到对应的角色")
7881

7982
async def generate_servettsrequest(
8083
self,

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "nonebot-plugin-fishspeech-tts"
3-
version = "0.2.7"
3+
version = "0.2.8"
44
description = "小样本TTS,通过调用在线或本地api发送TTS语音"
55
authors = ["Cvandia <106718176+Cvandia@users.noreply.github.com>"]
66
license = "MIT"

0 commit comments

Comments
 (0)