From c72b889a7379862ae580e48c89ac3c6af0b1f0d6 Mon Sep 17 00:00:00 2001 From: tarepan Date: Tue, 18 Jun 2024 21:34:44 +0900 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E7=90=86:=20`CoreSpeaker`=20=E3=81=AE?= =?UTF-8?q?=E5=BC=B7=E5=88=B6=20`Speaker`=20=E5=8C=96=E3=82=92=E5=89=8A?= =?UTF-8?q?=E9=99=A4=20(#1365)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit refactor: metas の部分的 speaker 化を削除 --- voicevox_engine/app/routers/speaker.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/voicevox_engine/app/routers/speaker.py b/voicevox_engine/app/routers/speaker.py index 84e3cc298..46fa312f7 100644 --- a/voicevox_engine/app/routers/speaker.py +++ b/voicevox_engine/app/routers/speaker.py @@ -5,7 +5,6 @@ from typing import Literal from fastapi import APIRouter, HTTPException -from pydantic import TypeAdapter from pydantic.json_schema import SkipJsonSchema from voicevox_engine.core.core_initializer import CoreManager @@ -46,8 +45,6 @@ def speaker_info( core_version=core_version, ) - _speaker_list_adapter = TypeAdapter(list[Speaker]) - # FIXME: この関数をどこかに切り出す def _speaker_info( speaker_uuid: str, @@ -78,9 +75,8 @@ def _speaker_info( # ... # 該当話者を検索する - speakers = _speaker_list_adapter.validate_python( - core_manager.get_core(core_version).speakers, from_attributes=True - ) + core_speakers = core_manager.get_core(core_version).speakers + speakers = metas_store.load_combined_metas(core_speakers) speakers = filter_speakers_and_styles(speakers, speaker_or_singer) speaker = next( filter(lambda spk: spk.speaker_uuid == speaker_uuid, speakers), None