diff --git a/manifest_assets/base_info.json b/manifest_assets/base_info.json index 5ff2fe36b..717ed0740 100644 --- a/manifest_assets/base_info.json +++ b/manifest_assets/base_info.json @@ -1,9 +1,5 @@ { "manifest_version": "0.12.0", "name": "dummy name", - "icon": "", - "default_sampling_rate": 24000, - "terms_of_service": "", - "update_infos": [], - "dependency_licenses": [] + "default_sampling_rate": 24000 } \ No newline at end of file diff --git a/voicevox_engine/engine_manifest/EngineManifest.py b/voicevox_engine/engine_manifest/EngineManifest.py index 90dd848bb..5d78a5d82 100644 --- a/voicevox_engine/engine_manifest/EngineManifest.py +++ b/voicevox_engine/engine_manifest/EngineManifest.py @@ -36,6 +36,3 @@ class EngineManifest(BaseModel): terms_of_service: str = Field(title="エンジンの利用規約") update_infos: List[UpdateInfo] = Field(title="エンジンのアップデート情報") dependency_licenses: List[LicenseInfo] = Field(title="依存関係のライセンス情報") - - class Config: - validate_assignment = True diff --git a/voicevox_engine/engine_manifest/EngineManifestLoader.py b/voicevox_engine/engine_manifest/EngineManifestLoader.py index 82e94c422..60e40e1d8 100644 --- a/voicevox_engine/engine_manifest/EngineManifestLoader.py +++ b/voicevox_engine/engine_manifest/EngineManifestLoader.py @@ -11,24 +11,24 @@ def __init__(self, assets_dir: Path): def load_manifest(self) -> EngineManifest: manifest = EngineManifest( - **json.load((self.assets_dir / "base_info.json").open(encoding="utf-8")) + **json.load((self.assets_dir / "base_info.json").open(encoding="utf-8")), + icon=b64encode((self.assets_dir / "icon.png").read_bytes()).decode("utf-8"), + terms_of_service=(self.assets_dir / "terms_of_service.md").read_text( + encoding="utf-8" + ), + update_infos=[ + UpdateInfo(**update_info) + for update_info in json.load( + (self.assets_dir / "update_infos.json").open(encoding="utf-8") + ) + ], + dependency_licenses=[ + LicenseInfo(**license_info) + for license_info in json.load( + (self.assets_dir / "dependency_licenses.json").open( + encoding="utf-8" + ) + ) + ], ) - manifest.icon = b64encode((self.assets_dir / "icon.png").read_bytes()).decode( - "utf-8" - ) - manifest.terms_of_service = (self.assets_dir / "terms_of_service.md").read_text( - encoding="utf-8" - ) - manifest.update_infos = [ - UpdateInfo(**update_info) - for update_info in json.load( - (self.assets_dir / "update_infos.json").open(encoding="utf-8") - ) - ] - manifest.dependency_licenses = [ - LicenseInfo(**license_info) - for license_info in json.load( - (self.assets_dir / "dependency_licenses.json").open(encoding="utf-8") - ) - ] return manifest