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:
@ -8,6 +8,7 @@ class SileroTtsProvider {
|
||||
//########//
|
||||
|
||||
settings
|
||||
ready = false
|
||||
voices = []
|
||||
separator = ' .. '
|
||||
|
||||
@ -60,9 +61,26 @@ class SileroTtsProvider {
|
||||
}, 2000);
|
||||
|
||||
$('#silero_tts_endpoint').val(this.settings.provider_endpoint)
|
||||
|
||||
this.checkReady()
|
||||
|
||||
console.info("Settings loaded")
|
||||
}
|
||||
|
||||
// Perform a simple readiness check by trying to fetch voiceIds
|
||||
async checkReady(){
|
||||
try {
|
||||
if (!modules.includes('silero-tts')){
|
||||
this.ready = false
|
||||
return
|
||||
}
|
||||
await this.fetchTtsVoiceIds()
|
||||
this.ready = true
|
||||
|
||||
} catch {
|
||||
this.ready = false
|
||||
}
|
||||
}
|
||||
|
||||
async onApplyClick() {
|
||||
return
|
||||
|
Reference in New Issue
Block a user