mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
add ready flag
This commit is contained in:
@ -84,6 +84,7 @@ class CoquiTtsProvider {
|
||||
//#############################//
|
||||
|
||||
settings
|
||||
ready
|
||||
|
||||
defaultSettings = {
|
||||
voiceMap: "",
|
||||
@ -147,6 +148,7 @@ class CoquiTtsProvider {
|
||||
loadSettings(settings) {
|
||||
// Only accept keys defined in defaultSettings
|
||||
this.settings = this.defaultSettings
|
||||
this.ready = false
|
||||
|
||||
for (const key in settings) {
|
||||
if (key in this.settings) {
|
||||
@ -227,6 +229,21 @@ class CoquiTtsProvider {
|
||||
});
|
||||
}
|
||||
|
||||
// Perform a simple readiness check by trying to fetch voiceIds
|
||||
async checkReady(){
|
||||
try {
|
||||
if (!modules.includes('coqui-tts')){
|
||||
this.ready = false
|
||||
return
|
||||
}
|
||||
await this.fetchTtsVoiceIds()
|
||||
this.ready = true
|
||||
|
||||
} catch {
|
||||
this.ready = false
|
||||
}
|
||||
}
|
||||
|
||||
updateVoiceMap() {
|
||||
this.settings.voiceMap = "";
|
||||
for (let i in this.settings.voiceMapDict) {
|
||||
|
Reference in New Issue
Block a user