Merge pull request #3392 from erew123/release fix: resolve URL duplication in AllTalk TTS audio output on V1 AllTalk

44343e8ec954c766d868826a7bed01a1f1e1ffbe

Cohee <18619528+Cohee1207@users.noreply.github.com>

Signed
1 files changed, +10 -6Showing whitespace changes
public/scripts/extensions/tts/alltalk.js+10 -6
@@ -388,7 +388,7 @@ class AllTalkTtsProvider {
388388 }
389389
390390 async fetchRvcVoiceObjects() {
391391 if (this.settings.server_version == 'v2v1') {
392392 console.log('Skipping RVC voices fetch for V1 server');
393393 return [];
394394 }
@@ -1031,14 +1031,18 @@ class AllTalkTtsProvider {
10311031 console.error('fetchTtsGeneration Error Response Text:', errorText);
10321032 throw new Error(`HTTP ${response.status}: ${errorText}`);
10331033 }
1034+
10341035 const data = await response.json();
10351036
1036- // Handle V1/V2 URL differences
1037+ // V1 returns a complete URL, V2 returns a relative path
10371038 const outputUrl =if (this.settings.server_version === 'v1') {
1038- ? data.output_file_url // V1 returns full URL
1039+ // V1: Use the complete URL directly from the response
1039- : `${this.settings.provider_endpoint}${data.output_file_url}`; // V2 returns relative path
1040+ return data.output_file_url;
1041+ } else {
1042+ // V2: Combine the endpoint with the relative path
1043+ return `${this.settings.provider_endpoint}${data.output_file_url}`;
1044+ }
10401045
1041- return outputUrl;
10421046 } catch (error) {
10431047 console.error('[fetchTtsGeneration] Exception caught:', error);
10441048 throw error;