Fix showing TTS model bug,add default TTS model.

This commit is contained in:
AxeKam333 2025-03-26 12:52:52 +01:00
parent 2f645b6961
commit 3233ce4746
2 changed files with 14 additions and 13 deletions

View File

@ -44,7 +44,7 @@ class SMSEagle extends NotificationProvider {
sendMethod = "/tts_call";
} else if (notification.smseagleMsgType == "smseagle-tts-advanced") {
sendMethod = "/tts_adv_call";
voice_id = notification.smseagleTtsModel;
voice_id = notification.smseagleTtsModel ? notification.smseagleTtsModel : 1 ;
}
}
@ -130,7 +130,7 @@ class SMSEagle extends NotificationProvider {
endpoint = "/calls/tts";
} else if (notification.smseagleMsgType == "smseagle-tts-advanced") {
endpoint = "/calls/tts_advanced";
postData["voice_id"] = notification.smseagleTtsModel;
postData["voice_id"] = notification.smseagleTtsModel ? notification.smseagleTtsModel : "1" ;
}
}

View File

@ -45,18 +45,19 @@
<option value="smseagle-tts">{{ $t("smseagleMsgTts") }} </option>
<option value="smseagle-tts-advanced">{{ $t("smseagleMsgTtsAdvanced") }} </option>
</select>
</div>
<div v-if="$parent.notification.smseagleMsgType === 'smseagle-ring'
|| $parent.notification.smseagleMsgType === 'smseagle-tts'
|| $parent.notification.smseagleMsgType === 'smseagle-tts-advanced'" class="mb-3">
<label for="smseagle-duration" class="form-label">{{ $t("smseagleDuration") }}</label>
<input id="smseagle-duration" v-model="$parent.notification.smseagleDuration" type="number" class="form-control" min="0" max="30" step="1" placeholder="10">
</div>
<div v-if="$parent.notification.smseagleMsgType === 'smseagle-tts-advanced'" class="mb-3">
<label for="smseagle-tts-model" class="form-label">{{ $t("smseagleTtsModel") }} </label>
<input id="smseagle-tts-model" v-model="$parent.notification.smseagleTtsModel" type="number" class="form-control" required>
<div v-if="$parent.notification.smseagleMsgType === 'smseagle-ring'
|| $parent.notification.smseagleMsgType === 'smseagle-tts'
|| $parent.notification.smseagleMsgType === 'smseagle-tts-advanced'" class="mb-3">
<label for="smseagle-duration" class="form-label">{{ $t("smseagleDuration") }}</label>
<input id="smseagle-duration" v-model="$parent.notification.smseagleDuration" type="number" class="form-control" min="0" max="30" step="1" placeholder="10">
</div>
<div v-if="$parent.notification.smseagleMsgType === 'smseagle-tts-advanced'" class="mb-3">
<label for="smseagle-tts-model" class="form-label">{{ $t("smseagleTtsModel") }} </label>
<input id="smseagle-tts-model" v-model="$parent.notification.smseagleTtsModel" type="number" class="form-control" placeholder="1" required>
</div>
</div>
</div>
<div v-if="$parent.notification.smseagleApiType === 'smseagle-apiv2'" class="mb-3">
<div class="mb-3">
<label for="smseagle-recipient-type" class="form-label">{{ $t("smseagleRecipient") }}</label>
@ -96,7 +97,7 @@
</div>
<div v-if="$parent.notification.smseagleMsgType === 'smseagle-tts-advanced'" class="mb-3">
<label for="smseagle-tts-model" class="form-label">{{ $t("smseagleTtsModel") }} </label>
<input id="smseagle-tts-model" v-model="$parent.notification.smseagleTtsModel" type="number" class="form-control" required>
<input id="smseagle-tts-model" v-model="$parent.notification.smseagleTtsModel" type="number" class="form-control" placeholder="1" required>
</div>
</div>
</template>